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:reply-to:subject:to:references:from:message-id
	:date:mime-version:in-reply-to:content-type
	:content-transfer-encoding; q=dns; s=default; b=hd7wzHDNhYdx7iFQ
	0luwCrVnz64BryueYlcLmuoMn1UdwwFf5ppcmM9kWTL8cVFw/zR6Pg2UnWugAyap
	EoW8mZfaMoUrv9GP5XltBw443lPuoHSkhUc4YrQRnu3286VtdrDIdRpyKhC2rvXx
	XspgYgylMcqRXG+f57Qm92TTR7s=
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:reply-to:subject:to:references:from:message-id
	:date:mime-version:in-reply-to:content-type
	:content-transfer-encoding; s=default; bh=hjPCcpF8IkF1MUtL9++vWw
	VM1zY=; b=uhNt2LO0aTnqFoDo4RAMqNVwWdxEkAOEgqx2Obb7/fox1/4Iyj06eN
	0VWY/mHI/Dw8uZbnYo1W5D2M9YrSJcVuq82mC5JjXr2Z5FCBSCeHYewQfTXwYYCu
	1yqXDOSDO1WC/MBkTRNVLmgnzFvQZKOXA7iOcvkx2alAHjCHL06gU=
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: =?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
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 <Brian.Inglis@SystematicSw.ab.ca>
Message-ID: <712afd0b-4ec1-d5f4-48e8-c046e1086ea7@SystematicSw.ab.ca>
Date: Tue, 27 Mar 2018 09:59:42 -0600
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
Note-from-DJ: This may be spam

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

