Cygwin programs doesn't support non-ASCII filenames
Lenik
lenik@bodz.net
Sat May 9 03:43:00 GMT 2009
(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/
More information about the Cygwin
mailing list