www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/05/16/01:17:45

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RCVD_NUMERIC_HELO,SARE_SUB_ENC_UTF8,SPF_HELO_PASS,SPF_PASS
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Lenik <lenik AT bodz DOT net>
Subject: Re: [1.7] Proposal: the filename encoding in C locale uses UTF-8 instead of SO/UTF-8
Date: Sat, 16 May 2009 13:17:11 +0800
Lines: 63
Message-ID: <guli8n$ti2$1@ger.gmane.org>
References: <3f0ad08d0905121029j119c8a7ep41d3a261d8bea338 AT mail DOT gmail DOT com>
Mime-Version: 1.0
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b3pre) Gecko/20090223 Thunderbird/3.0b2
In-Reply-To: <3f0ad08d0905121029j119c8a7ep41d3a261d8bea338@mail.gmail.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Note-from-DJ: This may be spam

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019