changeset 17916:8e426eb13aae

localename: Implement gl_locale_name_thread_unsafe for Android * lib/localename.c: Android API level >= 21 supports two hardcoded locales: C (POSIX) and C.UTF-8. Distinguish them by checking the internal __locale_t struct.
author Kevin Cernekee <cernekee@google.com>
date Mon, 16 Feb 2015 17:26:49 -0800
parents ee9d88df0605
children c513a8c0f555
files ChangeLog lib/localename.c
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-02-16  Kevin Cernekee  <cernekee@google.com>
+
+	localename: Implement gl_locale_name_thread_unsafe for Android
+	* lib/localename.c: Android API level >= 21 supports two hardcoded
+	locales: C (POSIX) and C.UTF-8.  Distinguish them by checking
+	the internal __locale_t struct.
+
 2015-02-16  Kamil Dudka  <kdudka@redhat.com>
 
 	fts: avoid crash when a cycle is added while traversing
--- a/lib/localename.c
+++ b/lib/localename.c
@@ -2730,6 +2730,8 @@
 #  elif defined __sun
         /* Solaris >= 12.  */
         return getlocalename_l (category, thread_locale);
+#  elif defined __ANDROID__
+        return MB_CUR_MAX == 4 ? "C.UTF-8" : "C";
 #  endif
       }
   }