diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-10-07 19:04:50 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-10-08 03:05:45 +0000 |
commit | bce13644e9d528a153f87019738a1582c9cae606 (patch) | |
tree | 4b662ab2fd3274da65c1fdc09a8995a436af798b /editcap.c | |
parent | 9388bd0436550e456fb0d9957a8328f1124c4800 (diff) |
Bring back arg_list_utf_16to8(), but have it just do UTF-16-to-UTF-8 mapping.
Call it from wmain() in the command-line tools, passing it the input
argument count and vector, and call it from main() in Wireshark, after
getting a UTF-16 argument vector from passing the result of
GetCommandLineW() to CommandLineToArgvW().
Change-Id: I0e51703c0a6c92f7892d196e700ab437bd702514
Reviewed-on: https://code.wireshark.org/review/30063
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'editcap.c')
-rw-r--r-- | editcap.c | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -1954,15 +1954,12 @@ clean_exit: #ifdef _WIN32 int -wmain(int argc, wchar_t *argv[]) +wmain(int argc, wchar_t *wc_argv[]) { - char **argv_utf8; + char **argv; - /* Convert our arg list from UTF-16LE to UTF-8. */ - argv_utf8 = g_malloc(argc * sizeof *argv_utf8); - for (int i = 0; i < argc; i++) - argv_utf8[i] = g_utf16_to_utf8(argv[i], -1, NULL, NULL, NULL); - return real_main(argc, argv_utf8); + argv = arg_list_utf_16to8(argc, wc_argv); + return real_main(argc, argv); } #else int |