delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/10/06/21:20:57

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 02ADF384BC3C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1602033608;
bh=cpy2XH1lcpPwHX+AKrKANUfoIKhatW5xtz9CIO29JV8=;
h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
From;
b=R0cBXBbydGWx3zRJvp9p+HrfJqMM0ucfmGYNzF/kY0CppHqwl8+ap9KQN4VnjS+fS
ONuPCAWaE4y4fNkmSzxYalF1eS7oX75dYVYJDFKK+eB1zUgt1hwXQMOP6CLz37RxJQ
Bv74pbEKmgWiq7FuCSbyFJRtJVrdh5rnoWeBue5c=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 176773858D35
Date: Wed, 7 Oct 2020 04:10:19 +0300
X-Mailer: The Bat! (v6.8.8) Home
X-Priority: 3 (Normal)
Message-ID: <1094935297.20201007041019@yandex.ru>
To: =?utf-8?Q?J=C3=A9r=C3=B4me_Froissart?= <software AT froissart DOT eu>,
cygwin AT cygwin DOT com
Subject: Re: Unconsistent command-line parsing in case of UTF-8 quoted
arguments
In-Reply-To: <CAFC9CLCHk0WMj935OzZF+HeAdDbv-kGU_SHyi47vohagM+ZmtQ@mail.gmail.com>
References: <CAFC9CLCtfMORMxAK6==jdwY5ZbX6jWwo+JCfDwM3njgvGduf0w AT mail DOT gmail DOT com>
<634821436 DOT 20201004141809 AT yandex DOT ru>
<CAFC9CLCHk0WMj935OzZF+HeAdDbv-kGU_SHyi47vohagM+ZmtQ AT mail DOT gmail DOT com>
MIME-Version: 1.0
X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_THEBAT,
NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,
SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Andrey Repin via Cygwin <cygwin AT cygwin DOT com>
Reply-To: cygwin AT cygwin DOT com
Cc: Andrey Repin <anrdaemon AT yandex DOT ru>
Errors-To: cygwin-bounces AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 0971KZLD012978

Greetings, Jérôme Froissart!

> Now, let's start a Windows shell (cmd.exe)

That explains it.

> Note that I had to copy cygwin1.dll from my Cygwin installation
> directory, otherwise binary.exe would not start.
> I do not know whether there is a `locale` equivalent in Windows

We've specifically asked to run Cygwin's /bin/locale.exe tool.

> command prompt, so I merely ran my program.
>     C:\Users\Public>binary.exe "foo bar" "Jérôme"
>     C=binary.exe  "foo bar" "Jâ–¡râ–¡me"
>     0=binary
>     1=foo bar
>     2="Jérôme"

> This behaviour is not expected and is quite inconsistent with what
> happened through Bash.
> Besides the "strange squares" that appear on the first line, and the

1. Run CMD in a more capable terminal. Either M$ Terminal 1.0, or select true
type font for your console.

> extra space after binary.exe, I especially did not expect "Jérôme" to
> remain quoted as a second argument.

2. Then you are parsing the command line wrong. In Windows, it is up to called
program to parse the command line.

> Sorry for the delay in my answer. I hope this is now clear, please ask
> me for more examples or investigation if you need.
> Thanks for your help.


-- 
With best regards,
Andrey Repin
Wednesday, October 7, 2020 1:02:59

Sorry for my terrible english...
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019