]> Savannah Git Hosting - gnulib.git/commit
localcharset, localename: MS-Windows support for non-default locales
authorEli Zaretskii <eliz@gnu.org>
Tue, 15 Jul 2014 19:18:48 +0000 (12:18 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 15 Jul 2014 19:19:30 +0000 (12:19 -0700)
commitb2f9ff7b19fedfe58144693c999b9a0c067cc131
treeadc45b6764204fe24e240fd17ce8e2048e06ac82
parent0172fd52dda0ff124002595a1c31cdec9e28a5e9
localcharset, localename: MS-Windows support for non-default locales

* lib/localcharset.c (locale_charset) [WINDOWS_NATIVE]: Before
falling back on the default system codepage, try extracting
the codepage from what 'setlocale' returns.  This allows to
take into account changes of the codeset due to non-default
locale set by a previous call to 'setlocale'.
* lib/localename.c (LOCALE_NAME_MAX_LENGTH) [WINDOWS_NATIVE]:
Define if not already defined.
(enum_locales_fn, get_lcid) [WINDOWS_NATIVE]: New functions.
(gl_locale_name_thread) [WINDOWS_NATIVE]: Produce the
current locale by calling 'setlocale', then converting the
locale name into LCID by calling 'get_lcid'.  This allows to
take into account changes in the current locale from the
default one, in contrast to GetThreadLocale.
ChangeLog
lib/localcharset.c
lib/localename.c