public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Andrey Repin <anrdaemon@yandex.ru>
To: h_ono@ot.olympus.co.jp, cygwin@cygwin.com
Subject: Re: cmd.exe and file name conversion from comman line argument
Date: Fri, 27 Jul 2018 07:27:00 -0000	[thread overview]
Message-ID: <1734760903.20180727075912@yandex.ru> (raw)
In-Reply-To: <OFADDE98D4.BA910041-ON492582D7.00014612-492582D7.00053602@ot.olympus.co.jp>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 2399 bytes --]

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...\x03B‹KCB”\x1c›Ø›\x19[H\x1c™\^[ܝ\x1cΈ\b\b\b\b\b\b\x1a\x1d\x1d\x1c\x0e‹ËØÞYÝÚ[‹˜ÛÛKÜ\x1c›Ø›\x19[\Ëš\x1d^[[\x03B‘TNˆ\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\x1a\x1d\x1d\x1c\x0e‹ËØÞYÝÚ[‹˜ÛÛKÙ˜\KÃB‘^[ØÝ[Y[\x18]\x1a[ÛŽˆ\b\b\b\b\b\b\b\b\x1a\x1d\x1d\x1c\x0e‹ËØÞYÝÚ[‹˜ÛÛKÙ^[ØÜËš\x1d^[[\x03B•[œÝXœØÜšX™H\x1a[™›Îˆ\b\b\b\b\b\x1a\x1d\x1d\x1c\x0e‹ËØÞYÝÚ[‹˜ÛÛKÛ[\vÈÝ[œÝXœØÜšX™K\Ú[\^[\x19CBƒB

  parent reply	other threads:[~2018-07-27  5:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-27  5:24 h_ono
2018-07-27  6:56 ` Marco Atzeri
2018-07-27  7:27 ` Andrey Repin [this message]
2018-07-27  8:08 ` Brian Inglis
2018-07-27  9:15   ` h_ono
2018-07-27 10:16     ` h_ono
2018-07-27 15:16     ` Takashi Yano
2018-07-30 10:54       ` h_ono

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1734760903.20180727075912@yandex.ru \
    --to=anrdaemon@yandex.ru \
    --cc=cygwin@cygwin.com \
    --cc=h_ono@ot.olympus.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).