GNU bug report logs -
#6546
win32 grep/shell utf-8 encoding
Previous Next
Full log
View this message in rfc822 format
Eli Zaretskii wrote:
>> Date: Fri, 23 Jul 2010 00:48:28 +0300
>> From: Laimonas Vėbra<laimonas.vebra <at> gmail.com>
>> CC: 6546 <at> debbugs.gnu.org
>>
>>> Did you try to add a suitably-valued LANG variable to
>>> process-environment? That would at least force Cygwin executables to
>>> work in the Windows codepage.
>>
>> The only way it works is when i set LANG process-environment variable to
>> the current windows locale codepage and 'coding-system-for-write' to the
>> encoding/charset in which i'd like to grep.
>
> That's the only way it's _supposed_ to work.
Then i suppose it's wrong/incorrect way of what is supposed to operate
like that.
Why? Because for the correct behaviour we (external app, Emacs)
shouldn't require to set locale to some fixed setting; it should be
freely changed as many cygwin apps relies on that. For example, how do
you sort data with improper locale settings (which are required to be
fixed)? Will seek for another workaround?
Example:
echo -e "-ĔĿİ-\n_ĔĿİ_\nELI\nĔĿİ" > file.txt
$ export LANG=lt_LT.cp1257
$ cat file.txt
-ĔĿİ-
_ĔĿİ_
ELI
ĔĿİ
$ cat file.txt | sort
_ĔĿİ_
ĔĿİ
-ĔĿİ-
ELI
$ export LANG=lt_LT.utf-8
$ cat file.txt
-ĔĿİ-
_ĔĿİ_
ELI
ĔĿİ
$ cat file.txt | sort
_ĔĿİ_
ELI
ĔĿİ
-ĔĿİ-
> Yes, this is the only setup that is supposed to work.
Maybe it is/was suppose to work (at all) like that in the sense of
workaround, but i doubt if it was/is supposed to be correct.
This bug report was last modified 3 years and 106 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.