From: AxlPr Date: Tue, 12 Nov 2013 09:31:11 +0000 (+0000) Subject: Fixed g_win32_getlocale X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=2e579c47fb6d7e31ebaa6c3df007764f79d97968;p=mono.git Fixed g_win32_getlocale Implemented g_win32_getlocale function to return correct locale. --- diff --git a/eglib/src/gmisc-win32.c b/eglib/src/gmisc-win32.c index 07dcf39aec8..f89f37c2204 100644 --- a/eglib/src/gmisc-win32.c +++ b/eglib/src/gmisc-win32.c @@ -87,10 +87,12 @@ g_unsetenv(const gchar *variable) gchar* g_win32_getlocale(void) { - /* FIXME: Use GetThreadLocale - * and convert LCID to standard - * string form, "en_US" */ - return strdup ("en_US"); + LCID lcid = GetThreadLocale(); + gchar buf[19]; + gint ccBuf = GetLocaleInfo(lcid, LOCALE_SISO639LANGNAME, buf, 9); + buf[ccBuf - 1] = '-'; + ccBuf += GetLocaleInfo(lcid, LOCALE_SISO3166CTRYNAME, buf + ccBuf, 9); + return strdup(buf); } gboolean