[WINESYNC] 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>

wine commit id 9dc5d299f11c599862d39af3e32d92e787c1ae7b by Aric Stewart <aric@codeweavers.com>
This commit is contained in:
winesync 2024-04-25 19:55:56 +03:00 committed by Timo Kreuzer
parent 535fffd824
commit a8d367089c

View file

@ -1015,6 +1015,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