Quotes around command-line argument that has unicode characters are not removed
Andrey Repin
anrdaemon@yandex.ru
Tue Mar 27 10:05:00 GMT 2018
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... ТÒÐÐ¥&ö&ÆVÒ&W÷'G3¢GG¢òö7wvâæ6öÒ÷&ö&ÆV×2æFÖÀФd¢GG¢òö7wvâæ6öÒöfðФFö7VÖVçFFöã¢GG¢òö7wvâæ6öÒöFö72æFÖÀÐ¥Vç7V'67&&Ræfó¢GG¢òö7wvâæ6öÒöÖÂò7Vç7V'67&&R×6×ÆPÐ Ð
More information about the Cygwin
mailing list