kernel32: Improve locale detection on Android.

setlocale is coded to just return 'C' for all inquiries ignoring locale
that may be set in the environment.

Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Aric Stewart 2017-03-30 12:56:38 -05:00 committed by Alexandre Julliard
parent 19d8fcc42e
commit 9dc5d299f1
1 changed files with 9 additions and 0 deletions

View File

@ -985,6 +985,15 @@ static const char* get_locale(int category, const char* category_name)
{
const char* ret = setlocale(category, NULL);
#ifdef __ANDROID__
if (!strcmp(ret, "C"))
{
ret = getenv( category_name );
if (!ret || !ret[0]) ret = getenv( "LC_ALL" );
if (!ret || !ret[0]) ret = "C";
}
#endif
#ifdef __APPLE__
/* If LC_ALL is set, respect it as a user override.
If LC_* is set, respect it as a user override, except if it's LC_CTYPE