From d97bfb1db5f29d8b7d8f3e22d615b86705ccd3b1 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 18 Aug 2005 00:40:37 +0000 Subject: Use g_get_charset() on Win32 to get locale charset. Free return value from 2005-08-18 Tor Lillqvist * e-iconv.c (e_iconv_init): Use g_get_charset() on Win32 to get locale charset. Free return value from g_win32_getlocale(). svn path=/trunk/; revision=30151 --- e-util/ChangeLog | 5 +++++ e-util/e-iconv.c | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/e-util/ChangeLog b/e-util/ChangeLog index 11f2091351..91ca6caff7 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,8 @@ +2005-08-18 Tor Lillqvist + + * e-iconv.c (e_iconv_init): Use g_get_charset() on Win32 to get + locale charset. Free return value from g_win32_getlocale(). + 2005-08-10 Tor Lillqvist * e-xml-utils.c (e_xml_get_child_by_name_by_lang): Use diff --git a/e-util/e-iconv.c b/e-util/e-iconv.c index 6cf3987021..65f19b3b4a 100644 --- a/e-util/e-iconv.c +++ b/e-util/e-iconv.c @@ -300,6 +300,11 @@ e_iconv_init(int keep) locale_charset = NULL; locale_lang = NULL; } else { +#ifdef G_OS_WIN32 + g_get_charset (&locale_charset); + locale_charset = g_strdup (locale_charset); + e_strdown (locale_charset); +#else #ifdef HAVE_CODESET locale_charset = g_strdup (nl_langinfo (CODESET)); e_strdown (locale_charset); @@ -325,12 +330,16 @@ e_iconv_init(int keep) locale_charset = NULL; } #endif +#endif /* !G_OS_WIN32 */ /* parse the locale lang */ locale_parse_lang (locale); } +#ifdef G_OS_WIN32 + g_free (locale); +#endif if (!keep) UNLOCK(); } -- cgit