[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[patch #6869] fgrep/egrep returns wrong matched none UTF-8 chars
From: |
Norihirio Tanaka |
Subject: |
[patch #6869] fgrep/egrep returns wrong matched none UTF-8 chars |
Date: |
Mon, 20 Jul 2009 02:36:24 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.9.1) Gecko/20090624 Firefox/3.5 |
Follow-up Comment #1, patch #6869 (project grep):
The usage of `echo' is incorrect. Instead, use `printf'.
$ /bin/echo -e "x81x30x89x38"
x81x30x89x38
$ /bin/echo -e "x81x30x89x38" | od -tx1 -Ax
000000 5c 78 38 31 5c 78 33 30 5c 78 38 39 5c 78 33 38
000010 0a
000011
$ printf "x81x30x89x38" | od -tx1 -Ax
000000 81 30 89 38
000004
$ printf "x81x30x89x38" | LANG=zh_CN.gb18030 grep -o '0'
$ printf "x81x30x89x38" | LANG=C grep -o '0'
0
$ grep --version
GNU grep 2.5.4
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/patch/?6869>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/