X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:subject:to:references:from:message-id:date
	:mime-version:in-reply-to:content-type
	:content-transfer-encoding; q=dns; s=default; b=x71QLq00/SeRFsSd
	any0Jmv3NXtTo5Vjo3QDp/oqlwOSR6RTFn2IAzBlXYh+oyA6jRWT5gIbiOGMWI5n
	u1QvA+AkgPwOACQA/f3OG01wnlK6cYlYJH8B88IULgYAUmAy6OWnUvpikQFZJho5
	g9QPXckuctcTZJF4HBQv3ZI/3bk=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:subject:to:references:from:message-id:date
	:mime-version:in-reply-to:content-type
	:content-transfer-encoding; s=default; bh=iO1BZZzwM+BW15ON4xD3Ug
	GqFBQ=; b=EQ5WTVsrTTFP49X27ohYJxFQ/2lB5U1FMvX8g9buThjvaw56NjwlbO
	7pZ6N6AtLDN1MfmoTSIJpkd3lTAVlEeOrKFt7beICPmcarIoNuyzCk7EPSSA6e1B
	JyM6hI400TOPZhctZjiFJyUIBaUUs0DyJmPkor0VcMWBmCaK21OkA=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy=UD:htm, HContent-Transfer-Encoding:8bit
X-HELO: mout.kundenserver.de
Subject: Re: Quotes around command-line argument that has unicode characters are not removed
To: cygwin@cygwin.com
References: <08d9621d-b9a0-c0d7-b58b-581ab957a08c@mail.ru> <1547310513.20180322142446@yandex.ru>
From: Thomas Wolff <towo@towo.net>
Message-ID: <80cca6dd-f7a7-3dda-9c95-8bfb9e97956d@towo.net>
Date: Fri, 23 Mar 2018 08:39:21 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0
MIME-Version: 1.0
In-Reply-To: <1547310513.20180322142446@yandex.ru>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-UI-Out-Filterresults: notjunk:1;V01:K0:CRrQ+hSBmn8=:oGzCH/XEPgcaMt84Q4mbd9 LaL7xTwmD7jqaOPpCqoI2E6W5uPXEdmrwfvcC1ki8vn0ubnVdbpZOABZiw12PibZPZMjJx2Xc GzdcKg+IWn2elDrh5G4funCKcPh3VWsCBr/MJAOrQDaJI+Jrw5mv19gU6rZGaayZFe1R3vR/h dPV3tuImYRjK7ZxvsvSTEWLdpUlwl+34e9B7vqj8HgMu9pMmKz9e9dNUJyaAW4ISqTI8Gl0Bq KTA9mGsnfNps1ooWRH1AUYhwRwAHHdN1Wt1RqYTQ4wOPUmsvIFNvTkbagHCPGmOPn3itwr96Y GDPRmsfyF15LRhYaTO9SB2QHNuW+OQFBaN1m26Q6jbIWSZjpdpNkwdsaUykaBzh7gYUDK+XhE Um80EFfOgRgIFzvusczvWnUro0S+JddY0BhIH2HX6D68oU80xF5hadxZsn5db9H8sLPeTbtww iaJr6uLpPIyn6Zz0O4ybst8lNN5WyxNcGa7QwM9wK4O6CAXvZjM4u5Ec1wikgFJBH039oz49c OuVJArPEqGj0KFOwlamY1dap66P9SarlCWTmbQLSSHBeSvq9IiYLvvQB5MqKqqVkKVxqLt5ur Ehnt1KAlGmVs0w7AhFs+90fMpWgSvgaFOx8I/zySZW7GwEZaX2sX4pk0wYem2hNWqZBdIKxvP 4aYlQyumRRxOHwI/D6WcCCV6K4dCOFVgrHl0n5nhd8sMi4AeX5H4HWz3JLJ0938lgT2xDsJfT 0qxuIeSuLj8rvyjWpD3fYqICZ6Rb0YIU3TWirwFuUWOH4Vfkn2l1w0GbsNQ=
X-IsSubscribed: yes

Am 22.03.2018 um 12:24 schrieb Andrey Repin:
> ...
>> when I put quotes around file that has
>> non-ASCII symbols, these quotes are passed to argv of the process literally,
>> otherwise they are removed. I would expect that there is a consistency.
> Parameter unquoting done by the shell.
> CMD does that differently from POSIX shells.
cmd.exe applies some inconsistent "smart" (in an MS sense...) magic 
quoting; it adds additional quotes if the parameter contains non-ASCII 
characters.
>> I have written a small C program that displays arguments, and run it three times:
> ...
You can also test this with cygwin /bin/echo:
C:\cygwin\bin>.\echo "bla"
bla

C:\cygwin\bin>.\echo "blö"
"blö"

This is also the reason why 'chere' fails on non-ASCII directories.

>> As one can see, the last run fails. I am a bit puzzled: how can I pass the name
>> of the file with space and Unicode symbols? I need to do it in uniform way, as I
>> am calling a Cygwin program from native Windows program, as in [1].
Due to the weird cmd.exe behaviour, you cannot. However, cygwin could 
apply a workaround by magic unquoting.

Thomas

>> Any feedback is appreciated.
>> [1] https://sourceware.org/ml/cygwin/2016-05/msg00082.html
>> [2] http://daviddeley.com/autohotkey/parameters/parameters.htm
>> [3] https://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-at
>> [4] https://github.com/openunix/cygwin/blob/master/winsup/cygwin/dcrt0.cc#L177

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

