Fixed a bug in xml2po

http://bugzilla.gnome.org/show_bug.cgi?id=437371#c4

The condition to trigger the bug is that opening tag or the content of the tag contains non-ascii chars. e.g:
<title>Quotes are for weak people, strong people have their own opinions
- Dawid Węgliński (cla)</title>
<body>
<figure link="/images/gwn/20070917_cla.jpg"
short="cla" caption="Dawid Węgliński, aka cla"/>

The symptom is:
Stack trace:
Traceback (most recent call last):
File "xml2po.py", line 856, in ?
doSerialize(doc)
File "xml2po.py", line 589, in doSerialize
outtxt += doSerialize(child)
File "xml2po.py", line 583, in doSerialize
(starttag, content, endtag, translation) = processElementTag(node, repl, 1)
File "xml2po.py", line 525, in processElementTag
translation = translation.replace('' % (i), replacement)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position
635: ordinal not in range(128)

Comments

Erm, so my name's broken that app? ;o
Zhang Le said…
that app itself is broken, ;)

Popular posts from this blog

Ripple's XRP: Giving the Third-Largest Cryptocurrency a Second Look

Illinois Is Venezuela and the Solution Is Cryptocurrency