delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2011/12/07/13:07:46

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Date: Wed, 7 Dec 2011 19:06:53 +0100
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: [ANNOUNCEMENT] CALL FOR TESTING: Cygwin 1.7.10
Message-ID: <20111207180653.GB25743@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <announce DOT 20111206093746 DOT GA6222 AT calimero DOT vinschen DOT de> <566vd7hfmi3j980ic4m64d7bv91b5qm6uh AT 4ax DOT com> <20111207173808 DOT GA25743 AT calimero DOT vinschen DOT de> <lq9vd7hue8mef2rkdjpnljn12bm0r6ftum AT 4ax DOT com>
MIME-Version: 1.0
In-Reply-To: <lq9vd7hue8mef2rkdjpnljn12bm0r6ftum@4ax.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
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

On Dec  7 18:50, Bengt Larsson wrote:
> Corinna Vinschen wrote:
> >On Dec  7 18:00, Bengt Larsson wrote:
> >> Corinna Vinschen wrote:
> >> 
> >> >- cygwin_conv_path and cygwin_conv_path_list: In CCP_WIN_A_TO_POSIX and
> >> >  CCP_POSIX_TO_WIN_A conversions, use the current Windows ANSI or OEM
> >> >  charset, depending on the return value of AreFileApisANSI.  Up to Cygwin
> >> >  1.7.9, both conversions used the current Cygwin charset for the conversion.
> >> 
> >> Is that the right thing to do? I have LANG=C.UTF-8. If I pass a
> >> Windows-style filename on the command line, it's passed as UTF-8. How do
> >> I then convert that to Unix-style, UTF-8?
> >
> >First of all, don't do that.  Use POSIX paths.
> >
> >Second, it's not passed as UTF-8 if the called application is a
> >non-Cygwin application.  In fact, Cygwin calls CreateProcessW, so all
> >strings are converted to UTF-16 (aka UNICODE) when starting a non-Cygwin
> >child process.
> >
> >Third, as for Cygwin apps, don't use WIN_A, use WIN_W instead, because
> >that's encoding agnostic:
> 
> OK, thanks.

Just so it's clear why I did that, maybe you want to have a look into
the brief discussion on the cygwin-developers list:
http://cygwin.com/ml/cygwin-developers/2011-11/msg00000.html

Basically, apart from external sources, the multibyte Windows paths you
have are either returned from a Windows function, or they are supposed
to be put into a Windows function.  Since the multibyte Windows file
access functions use the ANSI or OEM codepage, it makes sense to use the
current ANSI or OEM codepage for the WIN_A conversions as well.  But in
fact I agree with Daniel's comment on the list:
http://cygwin.com/ml/cygwin-developers/2011-11/msg00002.html


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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