Martin Panter added the comment:
The basic idea of your patch may be reasonable, but something is not right.
Imagine the locale is something other than UTF-8. The input code will now
contain mojibake print("\xC3\xAB"), although the decode() call will translate
the result back to the expected "\xEB".
I suggest this 2nd version of the patch. I used io.TextIOWrapper to use the
locale encoding, and incorporated the other test character "\xEF". I also
changed the preliminary test to call input() instead of relying on the
interactive interpreter, quiet mode, etc.
Just to clarify, is the problem that Python (correctly) assumes UTF-8 encoding
on Android, but Readline does not unless you tweak the environment variable?
I.e. is Readline assuming ASCII or something and ignoring the test characters?
If so, it sounds like this may be a more general problem with Gnu tools and
libraries on Android.
----------
Added file: http://bugs.python.org/file46014/readline_multibyte.v2.patch
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue28997>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com