cmd.exe and file name conversion from comman line argument
Andrey Repin
anrdaemon@yandex.ru
Fri Jul 27 07:27:00 GMT 2018
Greetings, h_ono@ot.olympus.co.jp!
> Hello,
> There is strange behavior when naming a file from command line argument in
> cmd.exe cosole,
> using touch or mv.
No, your comparison is not fair.
> I use:
> touch (GNU coreutils) 8.26
> Packaged by Cygwin (8.26-2)
You're using "env" to begin with, which alters processing of parameters.
But I can't reproduce your case. The result is definitely does not contain the quotes.
chcp 65001
set LANG=ru_RU.UTF-8
env LANG=ja_JP.UTF-8 touch 'ããã'
It creates exactly the name I'd expect, even though I can't see it in console.
But Explorer don't lie and shows it proper.
> cygwin1.dll version 2.10.0
> in cmd.exe, doing
>> touch aaa
> and
>> touch 'aaa'
> give same file name aaa.
>> ls
> aaa
> but, when I use Japanese characters as file name, it gives different file
> names
> with and without the quote.
>> env LANG=ja_JP.UTF-8 touch ããã
> gives
>> env LANG=ja_JP.UTF-8 ls
> ããã
> but,
>> env LANG=ja_JP.UTF-8 touch 'ããã'
> gives file name with quote not stripped.
>> env LANG=ja_JP.UTF-8 ls
> 'ããã'
> If called from mintty + bash,
> $ env LANG=ja_JP.UTF-8 touch 'ããã'
> gives
> $ env LANG=ja_JP.UTF-8 ls
> ããã
> The problem is when I create a file containing spaces in its name.
> Creating a file in cmd.exe like:
>> env LANG=ja_JP.UTF-8 touch 'ãã ã'
> gives
>> env LANG=ja_JP.UTF-8 ls
> "'ãã ã'"
> (which is a file named 'ãã ã', not ãã ã)
> It seems, there is no way to create a file containing a space in its name,
> like
> ãã ã
> with commands such as touch or mv.
> Is it a normal behavior, or a bug?
> Is there any way to create a file containing Japanese characters and
> spaces in its name
> without quote added?
> FYI, With old cygwin (cygwin1.dll version 1.5.25), there were not such
> problem.
> Even from cmd.exe,
>> touch 'ãã ã'
> gave a file named 'ãã ã' (without the quote in real.)
--
With best regards,
Andrey Repin
Friday, July 27, 2018 7:50:49
Sorry for my terrible english...BKCBØ[H\ÜÎËØÞYÝÚ[ÛÛKÜØ[\Ë[BTNËØÞYÝÚ[ÛÛKÙ\KÃBØÝ[Y[][ÛËØÞYÝÚ[ÛÛKÙØÜË[B[ÝXØÜXH[ÎËØÞYÝÚ[ÛÛKÛ[ÈÝ[ÝXØÜXK\Ú[\CBB
More information about the Cygwin
mailing list