Error on unicode character \u00A0
When using Unicode character \u00A0 (non-breaking whitespace) in a strings.xml, I get the crash below. Anything wrong with my configuration (if there is any) or any quick fix for that?
u'00A0'
u'00A0'
u'00A0'
[failed] locale/strings.pot
Traceback (most recent call last):
File "/usr/local/bin/a2po", line 3, in
The important part of the error is: "UnicodeDecodeError: 'ascii' codec can't decode". We need to know why the ascii codec is used for Unicode/UTF-8.
If this still is a problem for you, please attach the xml file causing the error.
It seems I cannot attach an XML file here, but a very simple input file will do already:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="blabla">just some bla\u00a0bla</string>
</resources>
I am simply running a2po export --android . --gettext locale with python 2.7.12.
I tested on Python 3 and couldn't reproduce the issue - it just worked. I don't have time to look at this for Python 2.
PS! You cant use "\u00a0" inside the XML file, but I just replaced it with an actual non-breaking space.
I had a similar problem with unicode escapes. I did not get a crash, but instead all strings with unicode escape were being omitted. Based on this thread I installed android2po again using my python3 binaries and the problem went away.