aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2011-02-19 23:21:14 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2011-02-19 23:27:00 +0100
commitd4bfd8a504def0d077aa6a538f8789e4010884cd (patch)
treec7e5dea56f218261f605e2c1eda3c642dcb159f1 /src
parent8f8866ffc49452891150beabdc7299de13bac661 (diff)
downloadlogdiag-d4bfd8a504def0d077aa6a538f8789e4010884cd.tar.gz
logdiag-d4bfd8a504def0d077aa6a538f8789e4010884cd.tar.xz
logdiag-d4bfd8a504def0d077aa6a538f8789e4010884cd.zip
Convert encoding of command line filenames.
Fixes Windows.
Diffstat (limited to 'src')
-rw-r--r--src/logdiag.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/logdiag.c b/src/logdiag.c
index fd871f2..c9c6af2 100644
--- a/src/logdiag.c
+++ b/src/logdiag.c
@@ -53,7 +53,27 @@ main (int argc, char *argv[])
if (argc < 2)
ld_window_main_new (NULL);
else
- ld_window_main_new (argv[1]);
+ {
+ gchar *arg_utf8, *arg_filename;
+
+ arg_utf8 = g_locale_to_utf8 (argv[1], -1, NULL, NULL, &error);
+ if (error)
+ {
+ g_warning ("%s", error->message);
+ g_error_free (error);
+ return 1;
+ }
+ arg_filename = g_filename_from_utf8 (arg_utf8, -1, NULL, NULL, &error);
+ if (error)
+ {
+ g_warning ("%s", error->message);
+ g_error_free (error);
+ return 1;
+ }
+ ld_window_main_new (arg_filename);
+ g_free (arg_filename);
+ g_free (arg_utf8);
+ }
gtk_main ();
return 0;