From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113736 invoked by alias); 27 Mar 2018 15:59:51 -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 111174 invoked by uid 89); 27 Mar 2018 15:59:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: =?ISO-8859-1?Q?No, score=3.5 required=5.0 tests=AWL,BAYES_20,BODY_8BITS,GARBLED_BODY,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=canada, Canada, =d0=b5=d0=ba=d1, calgary?= X-HELO: smtp-out-so.shaw.ca Received: from smtp-out-so.shaw.ca (HELO smtp-out-so.shaw.ca) (64.59.136.138) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 27 Mar 2018 15:59:46 +0000 Received: from [192.168.1.100] ([24.64.240.204]) by shaw.ca with ESMTP id 0r0gfj3WGYxCT0r0hfHoWI; Tue, 27 Mar 2018 09:59:44 -0600 X-Authority-Analysis: v=2.3 cv=cav8UELM c=1 sm=1 tr=0 a=MVEHjbUiAHxQW0jfcDq5EA==:117 a=MVEHjbUiAHxQW0jfcDq5EA==:17 a=IkcTkHD0fZMA:10 a=NEAV23lmAAAA:8 a=zJYjufoqSN7g7f3LHRcA:9 a=QEXdDO2ut3YA:10 Reply-To: Brian.Inglis@SystematicSw.ab.ca 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> <20180322152437.a37c3dd3b778bba765e2124c@inbox.ru> <162182215.20180322162501@yandex.ru> <93d66ed8-4dea-ddec-e731-43301ce57271@mail.ru> <782948862.20180327125610@yandex.ru> From: Brian Inglis Message-ID: <712afd0b-4ec1-d5f4-48e8-c046e1086ea7@SystematicSw.ab.ca> Date: Tue, 27 Mar 2018 17:39:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <782948862.20180327125610@yandex.ru> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-CMAE-Envelope: MS4wfDqUsS3VBpZ5JGUXtqVgpYimOaS0As/1h7rk1GzQCbUKHnB33NBcpyHVOWvTlEV47uyh0V1NPDa8mmy9dVlAyo1NtuN6M14aPsI0+530Nn4N1PPQflbu W0Co6OqlUTh+336lhJFcmEXaNRx2XhKXVgwq3/LVbDMVdcJFpuuJ6mbMSWZ5KENHnA83KFW5ytQ0lA== X-IsSubscribed: yes X-SW-Source: 2018-03/txt/msg00419.txt.bz2 On 2018-03-27 03:56, Andrey Repin wrote: >>> 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 If you're using cmd you can also set AutoRun commands like: $ cat HKCU-SW-MS-Command_Processor-AutoRun-chcp_65001.reg Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\Software\Microsoft\Command Processor] "AutoRun"="@chcp 65001 >nul" - append " && command..." to add more commands to AutoRun; these must use only the common base characters. -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada -- 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