Home GnuPG
Diffusion GnuPG 90ddd1cf13cd

common: First take on handling Unicode command line args.

Description

common: First take on handling Unicode command line args.

* common/w32-misc.c: New.
* common/t-w32-cmdline.c: New.
* common/init.c: Include w32help.h.
(prepare_w32_commandline): New.
(_init_common_subsystems) [W32]: Call prepare_w32_commandline.
* common/Makefile.am (common_sources) [W32]: Add w32-misc.c
(module_tests): Add t-w32-cmdline
(t_w32_cmdline_LDADD): New.

The rules for the command line parser are not cleary specified - if at
all. See the comment in t-w32-cmdline.c.

We can't use the mingw version because that would require to change
all argv handling to be wchar_t and that only for Windows. That would
be too ugly. Parsing the command line into argv by us is much easier
and we can do that only if needed - i.e. if globing is required (we
are prepared for this) or a non-ASCII character has been encountered.
This way we keep things stable and only fix the currently not working
Unicode problem.

(cherry picked from commit deb6c94362c0f179de1cac18707aad2f51a21e10)

Details

Provenance
wernerAuthored on Mar 4 2021, 10:16 AM
Parents
rG1f59c4c8e2cf: gpg: Prepare for globing with UTF-8.
Branches
Unknown
Tags
Unknown
Tasks
T4398: Rework Console and command line handling on Windows