This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Cygwin programs doesn't support non-ASCII filenames
- From: Lenik <lenik at bodz dot net>
- To: cygwin at cygwin dot com
- Date: Sat, 09 May 2009 11:43:20 +0800
- Subject: Cygwin programs doesn't support non-ASCII filenames
(My system locale is zh_CN)
1, test path
>>> set LANG=& cygpath -am .
C:/Profiles/Shecti/æé
>>> set LANG=zh_CN.GBK& cygpath -am .
C:/Profiles/Shecti/æé
>>> set LANG=C& cygpath -am .
C:/Profiles/Shecti/ÃÃÃÃ
2, the `test' utility
>>> set LANG=& bash -c "D=$(cygpath -am .); if [ -d $D ]; then echo
ok $D; else echo fail $D; fi"
fail C:/Profiles/Shecti/æé
>>> set LANG=zh_CN.GB2312& bash -c "D=$(cygpath -am .); if [ -d $D
]; then echo ok $D; else echo fail $D; fi"
fail C:/Profiles/Shecti/æé
>>> set LANG=zh_CN.GBK& bash -c "D=$(cygpath -am .); if [ -d $D ];
then echo ok $D; else echo fail $D; fi"
ok C:/Profiles/Shecti/æé
>>> set LANG=C& bash -c "D=$(cygpath -am .); if [ -d $D ]; then
echo ok $D;else echo fail $D; fi"
fail C:/Profiles/Shecti/ÃÃÃÃ
3, the `cp' utility
>>> set LANG=& bash -c "F=$(cygpath -am .)/a.zip; if cp -f $F xyz;
then echo ok $D; else echo fail $D; fi"
cp: cannot stat `C:/Profiles/Shecti/æé/a.zip': No such file or
directory
fail
>>> set LANG=zh_CN.GB2312& bash -c "F=$(cygpath -am .)/a.zip; if cp
-f $F xyz; then echo ok $D; else echo fail $D; fi"
cp: cannot stat `C:/Profiles/Shecti/æé/a.zip': No such file or
directory
fail
>>> set LANG=zh_CN.GBK& bash -c "F=$(cygpath -am .)/a.zip; if cp -f
$F xyz; then echo ok $D; else echo fail $D; fi"
ok
>>> set LANG=C& bash -c "F=$(cygpath -am .)/a.zip; if cp -f $F xyz;
then echo ok $D; else echo fail $D; fi"
cp: cannot stat `C:/Profiles/Shecti/ÃÃÃÃ/a.zip': No such file or
directory
fail
4, the `d' utility
>>> set LANG=& bash -c "D=$(cygpath -am .); if d $D; then echo ok
$D; else echo fail $D; fi"
/mnt/c/Profiles/Shecti/âÃÂÂâÃÂÂ/C:/Profiles/Shecti/æé doesn't exist!
fail C:/Profiles/Shecti/æé
>>> set LANG=zh_CN.GB2312& bash -c "D=$(cygpath -am .); if d $D;
then echo ok $D; else echo fail $D; fi"
/mnt/c/Profiles/Shecti/âÃÂÂâÃÂÂ/C:/Profiles/Shecti/æé doesn't exist!
fail C:/Profiles/Shecti/æé
>>> set LANG=zh_CN.GBK& bash -c "D=$(cygpath -am .); if d $D; then
echo ok $D; else echo fail $D; fi"
/mnt/c/Profiles/Shecti/âÃÂÂâÃÂÂ/C:/Profiles/Shecti/æé doesn't exist!
fail C:/Profiles/Shecti/æé
>>> set LANG=C& bash -c "D=$(cygpath -am .); if d $D; then echo ok
$D; elseecho fail $D; fi"
/mnt/c/Profiles/Shecti/âÃÂÂâÃÂÂ/C:/Profiles/Shecti/ÃÃÃà doesn't exist!
fail C:/Profiles/Shecti/ÃÃÃÃ
Problems:
(1)
Executables `test', `cp' (and rm, cat, stat, find, etc. seems like
all of binutils) supports locale settings,
while `d' (and gcc, zip, unzip, gzip, gunzip, jar, vi, etc. not of
binutils) are not.
(2)
Even programs of binutils may not support locale settings correctly,
The GB2312 charset is a subset of GBK charset, and the characters `
æé' is included in GB2312 charset. So in this example, GB2312 SHOULD WORK.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/