summaryrefslogtreecommitdiff
path: root/tests/test-mbstowcs.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-mbstowcs.c')
-rw-r--r--tests/test-mbstowcs.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test-mbstowcs.c b/tests/test-mbstowcs.c
index a33511a07d..21ee0c95dd 100644
--- a/tests/test-mbstowcs.c
+++ b/tests/test-mbstowcs.c
@@ -65,6 +65,15 @@ main (int argc, char *argv[])
ASSERT (wc == 0);
}
+#ifdef __ANDROID__
+ /* On Android ≥ 5.0, the default locale is the "C.UTF-8" locale, not the
+ "C" locale. Furthermore, when you attempt to set the "C" or "POSIX"
+ locale via setlocale(), what you get is a "C" locale with UTF-8 encoding,
+ that is, effectively the "C.UTF-8" locale. */
+ if (argc > 1 && strcmp (argv[1], "5") == 0 && MB_CUR_MAX > 1)
+ argv[1] = "2";
+#endif
+
if (argc > 1)
{
int unlimited;