This is an archive of the discontinued LLVM Phabricator instance.

Add Android locale support and default locale fallback
AbandonedPublic

Authored by niravd on Feb 9 2016, 10:54 AM.

Details

Reviewers
srhines
Summary

This is based on the Bionic <ctype.h> declarations. Note that
unfortunately, the _ctype_ table exposed by this header has a bug
so a fixed copy is included here instead.

See src/support/android/locale_android.cpp for details.

Fallback to locale("C") - Android's newlocale() return null for anything
other than "", "C", and "POSIX", fallback to "C" to allow more tests to
run and uncover other issues.

Diff Detail

Event Timeline

niravd updated this revision to Diff 47342.Feb 9 2016, 10:54 AM
niravd retitled this revision from to Add Android locale support and default locale fallback.
niravd updated this object.
niravd added a reviewer: srhines.

Android is using the builtin rune table: https://github.com/llvm-mirror/libcxx/blob/master/include/__config#L814. We can't use the builtin ctype table on Android because it uses a mask that is not wide enough to implement some parts of the C++ standard properly.

Fallback to locale("C") - Android's newlocale() return null for anything
other than "", "C", and "POSIX", fallback to "C" to allow more tests to
run and uncover other issues.

That's just a bad idea. If we can't fulfill the locale that was requested then the call needs to fail.

niravd abandoned this revision.Feb 16 2016, 2:08 PM