aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
diff options
context:
space:
mode:
Diffstat (limited to 'tshark.c')
-rw-r--r--tshark.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/tshark.c b/tshark.c
index 2d84153611..e716aa9db3 100644
--- a/tshark.c
+++ b/tshark.c
@@ -667,8 +667,8 @@ must_do_dissection(dfilter_t *rfcode, dfilter_t *dfcode,
tap_listeners_require_dissection() || dissect_color;
}
-int
-main(int argc, char *argv[])
+static int
+real_main(int argc, char *argv[])
{
GString *comp_info_str;
GString *runtime_info_str;
@@ -764,7 +764,6 @@ main(int argc, char *argv[])
cmdarg_err_init(failure_warning_message, failure_message_cont);
#ifdef _WIN32
- arg_list_utf_16to8(argc, argv);
create_app_running_mutex();
#endif /* _WIN32 */
@@ -2259,6 +2258,26 @@ clean_exit:
return exit_status;
}
+#ifdef _WIN32
+int
+wmain(int argc, wchar_t *argv[])
+{
+ char **argv_utf8;
+
+ /* 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);
+}
+#else
+int
+main(int argc, char *argv[])
+{
+ return real_main(argc, argv);
+}
+#endif
+
/*#define USE_BROKEN_G_MAIN_LOOP*/
#ifdef USE_BROKEN_G_MAIN_LOOP