]> git.ipfire.org Git - thirdparty/curl.git/commit
tool: support UTF-16 command line on Windows
authorMarcel Raad <Marcel.Raad@teamviewer.com>
Fri, 12 Apr 2019 20:59:40 +0000 (22:59 +0200)
committerMarcel Raad <Marcel.Raad@teamviewer.com>
Thu, 14 May 2020 16:13:36 +0000 (18:13 +0200)
commit9e5669f3880674de262000e772ef21ec0cc874be
tree3f1f6e7353b5d807b164a7443c85840d47f5c8bf
parenta55c835e6b99f96e595ad11888a2714447998378
tool: support UTF-16 command line on Windows

- use `wmain` instead of `main` when `_UNICODE` is defined [0]
- define `argv_item_t` as `wchar_t *` in this case
- use the curl_multibyte gear to convert the command-line arguments to
  UTF-8

This makes it possible to pass parameters with characters outside of
the current locale on Windows, which is required for some tests, e.g.
the IDN tests. Out of the box, this currently only works with the
Visual Studio project files, which default to Unicode, and winbuild
with the `ENABLE_UNICODE` option.

[0] https://devblogs.microsoft.com/oldnewthing/?p=40643

Ref: https://github.com/curl/curl/issues/3747
Closes https://github.com/curl/curl/pull/3784
lib/curl_setup_once.h
src/tool_getparam.c
src/tool_main.c
src/tool_operate.c