Unconsistent command-line parsing in case of UTF-8 quoted arguments
Sun Oct 11 18:55:48 GMT 2020
Greetings, Jérôme Froissart!
> 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 . 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?
I would at least run it with LANG env. variable set.
F.e. LANG=ru_RU.UTF-8 in my case.
I further tweak it with
to get more consistent program output parsing experience.
>> 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 , 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 :-)
>  https://github.com/billziss-gh/sshfs-win/pull/208
>  https://github.com/billziss-gh/sshfs-win
ln -fs /proc/cygdrive/c/Windows/System32/chcp.com /usr/local/bin/chcp
With best regards,
Sunday, October 11, 2020 21:51:57
Sorry for my terrible english...
More information about the Cygwin