Module: wine Branch: master Commit: 9dc5d299f11c599862d39af3e32d92e787c1ae7b URL: http://source.winehq.org/git/wine.git/?a=commit;h=9dc5d299f11c599862d39af3e3...
Author: Aric Stewart aric@codeweavers.com Date: Thu Mar 30 12:56:38 2017 -0500
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
---
dlls/kernel32/locale.c | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c index e14aedb..a72a8aa 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -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