From 545110c9391c6e7f8a81bab9c8eb70101f12399e Mon Sep 17 00:00:00 2001 From: Ulf Lamping Date: Thu, 12 Jan 2006 22:38:37 +0000 Subject: fix #661 Win32: convert filenames coming in from command line parameters from locale (current code page) into utf8 encoding This must also be done for the other command line tools like tethereal, editcap and alike ... svn path=/trunk/; revision=17025 --- capture_opts.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'capture_opts.c') diff --git a/capture_opts.c b/capture_opts.c index 4b6595fad9..08f023e705 100644 --- a/capture_opts.c +++ b/capture_opts.c @@ -412,7 +412,12 @@ capture_opts_add_opt(capture_options *capture_opts, int opt, const char *optarg, capture_opts->real_time_mode = TRUE; break; case 'w': /* Write to capture file xxx */ +#if defined _WIN32 && (GLIB_MAJOR_VERSION > 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION >= 6)) + /* since GLib 2.6, we need to convert filenames to utf8 for Win32 */ + capture_opts->save_file = g_locale_to_utf8(optarg, -1, NULL, NULL, NULL); +#else capture_opts->save_file = g_strdup(optarg); +#endif capture_opts->output_to_pipe = capture_opts_output_to_pipe(capture_opts->save_file); break; case 'y': /* Set the pcap data link type */ -- cgit v1.2.3