From d4bfd8a504def0d077aa6a538f8789e4010884cd Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Sat, 19 Feb 2011 23:21:14 +0100
Subject: Convert encoding of command line filenames.
Fixes Windows.
---
src/logdiag.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
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;
--
cgit v1.2.3-70-g09d2