From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 89212 invoked by alias); 23 Mar 2018 07:39:34 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 89168 invoked by uid 89); 23 Mar 2018 07:39:34 -0000 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 Received: from mout.kundenserver.de (HELO mout.kundenserver.de) (217.72.192.75) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 23 Mar 2018 07:39:24 +0000 Received: from [192.168.178.45] ([95.90.237.87]) by mrelayeu.kundenserver.de (mreue104 [212.227.15.183]) with ESMTPSA (Nemesis) id 0MaKMq-1fJ8Yi32t6-00Jro7 for ; Fri, 23 Mar 2018 08:39:20 +0100 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 Message-ID: <80cca6dd-f7a7-3dda-9c95-8bfb9e97956d@towo.net> Date: Fri, 23 Mar 2018 07:58:00 -0000 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 X-SW-Source: 2018-03/txt/msg00371.txt.bz2 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