diff options
author | Marcel Raad <Marcel.Raad@teamviewer.com> | 2019-04-12 22:59:40 +0200 |
---|---|---|
committer | Marcel Raad <Marcel.Raad@teamviewer.com> | 2020-05-14 18:13:36 +0200 |
commit | 9e5669f3880674de262000e772ef21ec0cc874be (patch) | |
tree | 3f1f6e7353b5d807b164a7443c85840d47f5c8bf /lib | |
parent | a55c835e6b99f96e595ad11888a2714447998378 (diff) |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/curl_setup_once.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/curl_setup_once.h b/lib/curl_setup_once.h index 8890f3890..e7c00deab 100644 --- a/lib/curl_setup_once.h +++ b/lib/curl_setup_once.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -481,6 +481,8 @@ typedef int sig_atomic_t; #ifdef __VMS #define argv_item_t __char_ptr32 +#elif defined(_UNICODE) +#define argv_item_t wchar_t * #else #define argv_item_t char * #endif |