Use g_win32_getlocale() instead of setlocale() on Windows. setlocale()
authorTor Lillqvist <tml@iki.fi>
Tue, 4 Jan 2005 21:21:07 +0000 (21:21 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Tue, 4 Jan 2005 21:21:07 +0000 (21:21 +0000)
2005-01-04  Tor Lillqvist  <tml@iki.fi>

* glib/guniprop.c (get_locale_type): Use g_win32_getlocale()
instead of setlocale() on Windows. setlocale() returns strings
like "Turkish_Turkey".

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

index 8d8a63c..1085b27 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-01-04  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/guniprop.c (get_locale_type): Use g_win32_getlocale()
+       instead of setlocale() on Windows. setlocale() returns strings
+       like "Turkish_Turkey".
+
 2005-01-04  Matthias Clasen  <mclasen@redhat.com>
 
        Fix the inlining magic.  (#157536, Jens Hatlak, and
index 8d8a63c..1085b27 100644 (file)
@@ -1,3 +1,9 @@
+2005-01-04  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/guniprop.c (get_locale_type): Use g_win32_getlocale()
+       instead of setlocale() on Windows. setlocale() returns strings
+       like "Turkish_Turkey".
+
 2005-01-04  Matthias Clasen  <mclasen@redhat.com>
 
        Fix the inlining magic.  (#157536, Jens Hatlak, and
index 8d8a63c..1085b27 100644 (file)
@@ -1,3 +1,9 @@
+2005-01-04  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/guniprop.c (get_locale_type): Use g_win32_getlocale()
+       instead of setlocale() on Windows. setlocale() returns strings
+       like "Turkish_Turkey".
+
 2005-01-04  Matthias Clasen  <mclasen@redhat.com>
 
        Fix the inlining magic.  (#157536, Jens Hatlak, and
index 8d8a63c..1085b27 100644 (file)
@@ -1,3 +1,9 @@
+2005-01-04  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/guniprop.c (get_locale_type): Use g_win32_getlocale()
+       instead of setlocale() on Windows. setlocale() returns strings
+       like "Turkish_Turkey".
+
 2005-01-04  Matthias Clasen  <mclasen@redhat.com>
 
        Fix the inlining magic.  (#157536, Jens Hatlak, and
index 8d8a63c..1085b27 100644 (file)
@@ -1,3 +1,9 @@
+2005-01-04  Tor Lillqvist  <tml@iki.fi>
+
+       * glib/guniprop.c (get_locale_type): Use g_win32_getlocale()
+       instead of setlocale() on Windows. setlocale() returns strings
+       like "Turkish_Turkey".
+
 2005-01-04  Matthias Clasen  <mclasen@redhat.com>
 
        Fix the inlining magic.  (#157536, Jens Hatlak, and
index 1c3fb9f..8859ba6 100644 (file)
@@ -525,7 +525,16 @@ typedef enum {
 static LocaleType
 get_locale_type (void)
 {
+#ifdef G_OS_WIN32
+  char *tem = g_win32_getlocale ();
+  char locale[2];
+
+  locale[0] = tem[0];
+  locale[1] = tem[1];
+  g_free (tem);
+#else
   const char *locale = setlocale (LC_CTYPE, NULL);
+#endif
 
   switch (locale[0])
     {