[Python-ideas] PEP 538: Coercing the legacy C locale to C.UTF-8

Xavier de Gaye xdegaye at gmail.com
Wed Jan 18 10:51:21 EST 2017


 > On Android, the locale settings are of limited relevance (due to most
 > applications running in the UTF-16-LE based Dalvik environment) and there's
 > limited value in preserving backwards compatibility with other locale aware
 > C/C++ components in the same process (since it's a relatively new target
 > platform for CPython), so CPython bypasses the operating system provided APIs
 > and hardcodes the use of UTF-8 (similar to its behaviour on Apple platforms).

FWIW the default locale seems to be UTF-8 for java applications, the public
abstract class Charset Android documentation [1] says for the
defaultCharset() method:

     "Android note: The Android platform default is always UTF-8."

and wide character functions in the NDK use the UTF-8 encoding whatever the
locale set by setlocale(), see the test run by Chi Hsuan Yen in [2].

Xavier

[1] https://developer.android.com/reference/java/nio/charset/Charset.html
[2] http://bugs.python.org/issue26928#msg281110


More information about the Python-ideas mailing list