[1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8

Lenik lenik@bodz.net
Sat May 16 05:17:00 GMT 2009


(This mail is encoded in utf-8)

After tested with 1.7.0-48, many problems are eliminated.

But cygpath doesn't return good pathnames, see:

1, Get absolute path of current directory:

     C:\Profiles\Shecti\桌面> set LANG=zh_CN.GBK& cygpath -am .
     C:/Profiles/Shecti/桌面 (good)

     C:\Profiles\Shecti\桌面> set LANG=zh_CN.GBK& cygpath -au .
     /mnt/c/Profiles/Shecti/桌面/ (good)

     C:\Profiles\Shecti\桌面> set LANG=zh_CN.UTF-8& cygpath -am .
     C:/Profiles/Shecti/â–’â–’â–’â–’ (bad)

     C:\Profiles\Shecti\桌面> set LANG=zh_CN.UTF-8& cygpath -au .
     /mnt/c/Profiles/Shecti/桌面/ (good)

     C:\Profiles\Shecti\桌面> set LANG=C& cygpath -am .
     C:/Profiles/Shecti/â–’â–’â–’â–’ (bad)

     C:\Profiles\Shecti\桌面> set LANG=C& cygpath -au .
     /mnt/c/Profiles/Shecti/桌面/ (good)

     Conclusion:
         1.1 only GBK works for `cygpath -am .' (also -aw)
         1.2 all work for `cygpath -au .'

2, Get absolute path of specified path

     C:\Profiles\Shecti\桌面>set LANG=zh_CN.GBK& cygpath -am C:\Profiles 
\Shecti\桌面
     C:/Profiles/Shecti/妗岄潰 (bad)

     C:\Profiles\Shecti\桌面>set LANG=zh_CN.GBK& cygpath -au C:\Profiles 
\Shecti\桌面
     /mnt/c/Profiles/Shecti/妗岄潰 (bad)

     C:\Profiles\Shecti\桌面>set LANG=zh_CN.UTF-8& cygpath -am 
C:\Profiles\Shecti\桌面
     C:/Profiles/Shecti/â–’â–’â–’â–’ (bad)

     C:\Profiles\Shecti\桌面>set LANG=zh_CN.UTF-8& cygpath -au 
C:\Profiles\Shecti\桌面
     /mnt/c/Profiles/Shecti/桌面 (good)

     C:\Profiles\Shecti\桌面>set LANG=C& cygpath -am C:\Profiles\Shecti\桌面
     C:/Profiles/Shecti/â–’â–’â–’â–’ (bad)

     C:\Profiles\Shecti\桌面>set LANG=C& cygpath -au C:\Profiles\Shecti\桌面
     /mnt/c/Profiles/Shecti/桌面 (good)

     Conclusion:
         2.1 none works for `cygpath -am PathContainsNonascii'
         2.2 GBK doesn't work for `cygpath -au PathContainsNonascii'

Now the problem is, I must use GBK for 1.1, and I cannot use GBK for 
2.2. and no more choice.   -_-||...

Lenik



--
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