Convert filenames to UTF-8 on Windows.
authorMatthias Clasen <mclasen@redhat.com>
Sat, 30 Oct 2004 03:20:31 +0000 (03:20 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sat, 30 Oct 2004 03:20:31 +0000 (03:20 +0000)
2004-10-29  Matthias Clasen  <mclasen@redhat.com>

* glib/goption.c (parse_arg): Convert filenames to UTF-8 on
Windows.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib/goption.c

index 8c3b566..1542390 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-10-29  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/goption.c (parse_arg): Convert filenames to UTF-8 on
+       Windows.
+
 2004-10-29  Hans Breuer  <hans@breuer.org>
 
        * glibconfig.h */makefile.msc.in : updated [and finally fixed my
index 8c3b566..1542390 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-29  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/goption.c (parse_arg): Convert filenames to UTF-8 on
+       Windows.
+
 2004-10-29  Hans Breuer  <hans@breuer.org>
 
        * glibconfig.h */makefile.msc.in : updated [and finally fixed my
index 8c3b566..1542390 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-29  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/goption.c (parse_arg): Convert filenames to UTF-8 on
+       Windows.
+
 2004-10-29  Hans Breuer  <hans@breuer.org>
 
        * glibconfig.h */makefile.msc.in : updated [and finally fixed my
index 8c3b566..1542390 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-29  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/goption.c (parse_arg): Convert filenames to UTF-8 on
+       Windows.
+
 2004-10-29  Hans Breuer  <hans@breuer.org>
 
        * glibconfig.h */makefile.msc.in : updated [and finally fixed my
index 8c3b566..1542390 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-29  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/goption.c (parse_arg): Convert filenames to UTF-8 on
+       Windows.
+
 2004-10-29  Hans Breuer  <hans@breuer.org>
 
        * glibconfig.h */makefile.msc.in : updated [and finally fixed my
index 931d5c8..5905382 100644 (file)
@@ -658,8 +658,14 @@ parse_arg (GOptionContext *context,
       {
        gchar *data;
 
+#ifdef G_OS_WIN32
+       data = g_locale_to_utf8 (value, -1, NULL, NULL, error);
+       
+       if (!data)
+         return FALSE;
+#else
        data = g_strdup (value);
-
+#endif
        change = get_change (context, G_OPTION_ARG_FILENAME,
                             entry->arg_data);
        g_free (change->allocated.str);
@@ -675,8 +681,14 @@ parse_arg (GOptionContext *context,
       {
        gchar *data;
        
+#ifdef G_OS_WIN32
+       data = g_locale_to_utf8 (value, -1, NULL, NULL, error);
+       
+       if (!data)
+         return FALSE;
+#else
        data = g_strdup (value);
-
+#endif
        change = get_change (context, G_OPTION_ARG_STRING_ARRAY,
                             entry->arg_data);