diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2006-01-12 22:38:37 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2006-01-12 22:38:37 +0000 |
commit | 545110c9391c6e7f8a81bab9c8eb70101f12399e (patch) | |
tree | 3dd01a19a67c6711d4107d578ec71a2630d3d20f /capture_opts.c | |
parent | a9f4ae4f9940b1e3fcce14926711fa8f0ea37cc8 (diff) | |
download | wireshark-545110c9391c6e7f8a81bab9c8eb70101f12399e.tar.gz wireshark-545110c9391c6e7f8a81bab9c8eb70101f12399e.tar.bz2 wireshark-545110c9391c6e7f8a81bab9c8eb70101f12399e.zip |
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
Diffstat (limited to 'capture_opts.c')
-rw-r--r-- | capture_opts.c | 5 |
1 files changed, 5 insertions, 0 deletions
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 */ |