X-Recipient: archive-cygwin AT delorie DOT 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:date:from:reply-to:message-id:to:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=uC3+uFPJ1Fwihlrw ApPciZO9m/zrYppHjaRjmb42tvyhzK/1H4ixODiqvKzsn4uBLnVnribXaJiQyLhY f4CLs4aR6ZiyB/JsPy+6W7lKCgh31gO5ryZFcL2RVoAmglt56bAQ5Q+gUoW++30N HoBJgP4iLeL5RGVX8Bq6/5TKhbw= 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:date:from:reply-to:message-id:to:subject :in-reply-to:references:mime-version:content-type :content-transfer-encoding; s=default; bh=zh5zD72pNuXfmCzTQj+Aql uGliw=; b=t1nVEoX29x1gv/3Sa/BAxIZVLmpFUzeTfzQ8U6FjpS1abSwApZWDoy Gv1b2jWf/3MNx1GCuLbbkSv/Y6fL0WDrGYzj1t7OfeEN/OwmpD7z+ALaFG2Toobu Bf0IjgBP/Ji+vgRpxrR03XzF+co+M2IE015IY8lEKOU+L6bUfM0V8= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: =?ISO-8859-1?Q?No, score=4.7 required=5.0 tests=BAYES_05,BODY_8BITS,FREEMAIL_FROM,GARBLED_BODY,KAM_THEBAT,MIME_BASE64_BLANKS,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 spammy=H*F:D*yandex.ru, =d0=b5=d0=ba=d1, Console, Quotes?= X-HELO: forward105o.mail.yandex.net Authentication-Results: smtp4o.mail.yandex.net; dkim=pass header.i=@yandex.ru Date: Tue, 27 Mar 2018 12:56:10 +0300 From: Andrey Repin Reply-To: cygwin AT cygwin DOT com Message-ID: <782948862.20180327125610@yandex.ru> To: Dmitry Katsubo , cygwin AT cygwin DOT com Subject: Re: Quotes around command-line argument that has unicode characters are not removed In-Reply-To: <93d66ed8-4dea-ddec-e731-43301ce57271@mail.ru> References: <08d9621d-b9a0-c0d7-b58b-581ab957a08c AT mail DOT ru> <20180322152437 DOT a37c3dd3b778bba765e2124c AT inbox DOT ru> <162182215 DOT 20180322162501 AT yandex DOT ru> <93d66ed8-4dea-ddec-e731-43301ce57271 AT mail DOT ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id w2RA5KhL031039 Greetings, Dmitry Katsubo! >> Locale settings affecting Cygwin binary. >> >> If you >> set LANG=ru_RU.CP866 >> (f.e.) >> before invoking cygwin testcase in native CMD, you will likely see it >> working better. > Thanks for this advise, Andrey. I see that it reacts, but works worth :) > I think it advises to output characters in CP866, but console is UTF-8: > D:\cli> set LANG=ru_RU.CP866 > D:\cli> test "текст плюс.txt" > param 0 = test > param 1 = ⥪▒▒ ▒▒▒▒.txt > Failed to open '⥪▒▒ ▒▒▒▒.txt': No such file or directory > But.. ta-da! I made it working like that: > D:\cli> set LANG=ru_RU.UTF-8 > D:\cli> test "текст плюс.txt" > param 0 = test > param 1 = текст плюс.txt > File 'текст плюс.txt' was opened > Hooray, it worked! This is no magic. Console settings must match locale set in the environment. Please test again with "chcp" to get current console codepage and setting LANG to match it. I could not see which version of Windows you're using, sorry. It is possible that console is set to a different codepage than usual. >> Alternatively, you could try >> chcp 65001 > That does not help: > D:\cli> chcp 65001 > Active code page: 65001 > D:\cli> test "текст плюс.txt" > param 0 = test > param 1 = "текст плюс.txt" > Failed to open '"текст плюс.txt"': No such file or directory > [1] https://github.com/openunix/cygwin/blob/master/winsup/cygwin/dcrt0.cc#L297 > [2] https://github.com/openunix/cygwin/blob/master/winsup/cygwin/dcrt0.cc#L165 -- With best regards, Andrey Repin Tuesday, March 27, 2018 12:51:10 Sorry for my terrible english... -- 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