X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 	tests=AWL,BAYES_00,J_CHICKENPOX_41,SARE_MSGID_LONG40,SPF_PASS
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <4A1EF2CE.2060509@sidefx.com>
References: <200905281541.33404.michael.renner@gmx.de> 	 <20090528145106.GA23970@ednor.casa.cgf.cx> 	 <4A1EAA75.7030203@sidefx.com> <4A1EAAED.1060702@cygwin.com> 	 <4A1EAD61.5010308@sidefx.com> <4A1EAD91.1060701@sidefx.com> 	 <e2480c70905281131u37651a2eoba946637bd414516@mail.gmail.com> 	 <4A1EF2CE.2060509@sidefx.com>
Date: Sat, 30 May 2009 00:13:48 +0900
Message-ID: <3f0ad08d0905290813m39999f81q918e94e3c960eb3f@mail.gmail.com>
Subject: Re: 1.7.0-48: [BUG] Passing characters above 128 from bash command  	line
From: IWAMURO Motonori <deenheart@gmail.com>
To: cygwin@cygwin.com
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Hi.

The encoding of C locale is ASCII, and not ISO-8859-1.
I don't think ASCII is the same as ISO-8859-1.
Does it work on LANG=3Den_US.ISO-8859-1?

2009/5/29 Edward Lam <edward@sidefx.com>:
> Alexey Borzenkov wrote:
>>
>> On Thu, May 28, 2009 at 7:28 PM, Edward Lam <edward@sidefx.com> wrote:
>>>
>>> PS. In case you haven't noticed, copyright.txt is not a long file. It
>>> consists of a single byte, 0xA9.
>>
>> Did you try utf-8 encoding copyright.txt? Perhaps your locale is utf-8
>> and the encoder fails.
>
> How is one supposed to determine one's locale in cygwin? I do NOT have LA=
NG,
> or any of the LC environment variables set. I even tried explicitly setti=
ng
> LANG=3DC and it still fails.
>
> The problem does seem to stem from the new UTF-8 support in cygwin 1.7.
> However, I think something is going on here that is unexpected because
> trying something similar on Linux has no problems. To confirm that it was=
 an
> UTF-8 related problem, let me repeat the steps slightly differently again.
> Here we assume that I've already got bug.exe compiled which simply prints
> out its arguments.
>
> $ export LANG=3DC
>
> $ ./bug arg1 "before `cat copyright.txt` after" arg3
> 0: E:\cygwin1.7\tmp\bug.exe
> 1: arg1
> 2: before
>
> *Notice that argc is 3 when it should be 4!*
>
> $ piconv -f iso-8859-1 -t utf8 < copyright.txt > fubar.txt
>
> $ ./bug arg1 "before `cat fubar.txt` after" arg3
> 0: E:\cygwin1.7\tmp\bug.exe
> 1: arg1
> 2: before =A9 after
> 3: arg3
>
> *So now everything works because I converted the character into UTF-8.*
>
> I think what this points to is some form of invalid source encoding of the
> command line argument when spawning NATIVE applications.
>
> Here's what happens when I try to compile bug.c using cygwin's gcc:
>
> $ gcc bug.c -o bug-gcc.exe
>
> $ ./bug-gcc arg1 "before `cat copyright.txt` after" arg3
> 0: ./bug-gcc
> 1: arg1
> 2: before =A9 after
> 3: arg3
>
> So there seems to be some sort of special marshaling of the command line
> arguments that only works when spawning cygwin apps, but breaks when runn=
ing
> under native apps.
>
> Regards,
> -Edward
>
> --
> Unsubscribe info: =A0 =A0 =A0http://cygwin.com/ml/#unsubscribe-simple
> Problem reports: =A0 =A0 =A0 http://cygwin.com/problems.html
> Documentation: =A0 =A0 =A0 =A0 http://cygwin.com/docs.html
> FAQ: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 http://cygwin.com/faq/
>
>



--=20
IWAMURO Motnori <http://vmi.jp/>

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

