delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/10/07/18:22:31

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B83323851C2A
Authentication-Results: sourceware.org;
dmarc=none (p=none dis=none) header.from=froissart.eu
Authentication-Results: sourceware.org;
spf=pass smtp.mailfrom=jerome DOT froissart AT gmail DOT com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to:cc:content-transfer-encoding;
bh=aUjDf4MaE0lJdPRJ2j2BPZKIat3BwtX4aSYrmUpe7eg=;
b=OS1P1DSY4Rwwh66B2pSnKtUH3f+WxbOQPr11/9K8kiCh9Yt5HYPxs/5YRAc1U5pXlt
hrcbp7GJ5Hoc/E6N/NCn2AxvCKEwO2vxHbJlGEGGtGj5ldojPZ1AUWXI1rqfxCbUTerF
FYfFa3jvrwhCmbrvAlO0mdwSHCX8MOq34sQrdcCETv7KDDcVfkdzf7H1QcGeSh5/R7sE
t0RIIoLBTqPqYvkDeyTU86nRbkkI74iUY86RVP0wDQCas6iLgFuENupdhZszJ3cEzBLz
68VeyhGEyn8SStFI0AGgjRjxT6mXIpP+ySYPh+g/ZEYI9/fS4+NSH/Fe/wk04Q+DTebu
9uyg==
X-Gm-Message-State: AOAM5319JdyWEN02kVtk3+bpo7RKoOEHGuJf1eIJ0O0IYYBAH1jKGiEI
oDDR9uklNCOWY8k6YDnIU6MF3LamKhV9YYQpOg39mnOw
X-Google-Smtp-Source: ABdhPJww/WfistWSsOg527gJXcJPMNigEB2T5AogdPhGzBeiqxsvQIu8uRGs4BjhZC30TnOSSdlMnuJ8PeQqd7dk1sU=
X-Received: by 2002:a17:906:c10c:: with SMTP id
do12mr5450316ejc.527.1602109304475;
Wed, 07 Oct 2020 15:21:44 -0700 (PDT)
MIME-Version: 1.0
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>
<1094935297 DOT 20201007041019 AT yandex DOT ru>
In-Reply-To: <1094935297.20201007041019@yandex.ru>
From: =?UTF-8?B?SsOpcsO0bWUgRnJvaXNzYXJ0?= <software AT froissart DOT eu>
Date: Thu, 8 Oct 2020 00:21:34 +0200
Message-ID: <CAFC9CLCR8ydf=JNkqUAHCU1DjUZi-xurV+ohuXM3Nfh-NaHf8A@mail.gmail.com>
Subject: Re: Unconsistent command-line parsing in case of UTF-8 quoted
arguments
To: cygwin AT cygwin DOT com
X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,
FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,
KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, 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-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>
Cc: =?UTF-8?B?SsOpcsO0bWUgRnJvaXNzYXJ0?= <software AT froissart DOT eu>
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 097MMDq5015217

Thanks for your reply.

Andrey Repin wrote:
> 1. Run CMD in a more capable terminal. Either M$ Terminal 1.0, or select true
> type font for your console.
I tried Windows Terminal 1.3, but this did not change anything :-(
Besides, I think my cmd.exe was already using True Type fonts (if I
understand the icons from the settings window correctly)

Anyway, I now understand that the terminal I use matters. In my case
however, I do not intend to run the binary (built with Cygwin) in a
terminal at all.
I am using win-sshfs [2]. It is built from Cygwin, but it is then used
as a standalone executable, without any GUI. It is called by a Windows
component/driver (with a command line that contains quoted UTF-8
arguments), invoked by some clicks and actions from the 'My computer'
window. What could I do so that this program correctly handles the
command line?
> 2. Then you are parsing the command line wrong. In Windows, it is up to called
> program to parse the command line.
Right, but my program starts at `int main(int argc, char *argv[])`,
where the parsing is already handled (by some Cygwin runtime
component?). How could I parse it differently?
And would that even make sense that I parse it in a custom way? Since
-I suppose- every C program built by Cygwin faces the same issues,
wouldn't we rather want a "universal" change on how the Cygwin runtime
parses command lines?
For the record, this is what I have done in this program [1], but that
feels more like a work around some UTF-8-related bug than a proper,
custom command line parsing :-S

...or maybe I'm completely mistaken in how Cygwin works, in case I'd
be happy to be told :-)

[1] https://github.com/billziss-gh/sshfs-win/pull/208
[2] https://github.com/billziss-gh/sshfs-win

Thanks for your help
Jérôme
--
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