From b7de9fc3b6d2604efbdab2e07d7d2bbf834c5f45 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 4 Jan 2005 21:21:07 +0000 Subject: [PATCH] Use g_win32_getlocale() instead of setlocale() on Windows. setlocale() 2005-01-04 Tor Lillqvist * glib/guniprop.c (get_locale_type): Use g_win32_getlocale() instead of setlocale() on Windows. setlocale() returns strings like "Turkish_Turkey". --- ChangeLog | 6 ++++++ ChangeLog.pre-2-10 | 6 ++++++ ChangeLog.pre-2-12 | 6 ++++++ ChangeLog.pre-2-6 | 6 ++++++ ChangeLog.pre-2-8 | 6 ++++++ glib/guniprop.c | 9 +++++++++ 6 files changed, 39 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8d8a63c..1085b27 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-01-04 Tor Lillqvist + + * 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 Fix the inlining magic. (#157536, Jens Hatlak, and diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 8d8a63c..1085b27 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +2005-01-04 Tor Lillqvist + + * 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 Fix the inlining magic. (#157536, Jens Hatlak, and diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index 8d8a63c..1085b27 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,9 @@ +2005-01-04 Tor Lillqvist + + * 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 Fix the inlining magic. (#157536, Jens Hatlak, and diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 8d8a63c..1085b27 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +2005-01-04 Tor Lillqvist + + * 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 Fix the inlining magic. (#157536, Jens Hatlak, and diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 8d8a63c..1085b27 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +2005-01-04 Tor Lillqvist + + * 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 Fix the inlining magic. (#157536, Jens Hatlak, and diff --git a/glib/guniprop.c b/glib/guniprop.c index 1c3fb9f..8859ba6 100644 --- a/glib/guniprop.c +++ b/glib/guniprop.c @@ -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]) { -- 2.7.4