I saw a problem with pygettextpo validation and thus I wrote a test to know if it was a problem with it or with Rosetta.
The test is:
def testUnicodeString(self):
"""Test that a translation with unicode chars is working."""
msg = gettextpo.PoMessage()
msg.set_msgid(u'Carlos Perell\xf3 Mar\xedn')
msg.set_msgstr(u'Carlos Perell\xf3 Mar\xedn')
And the test run output:
carlos@frodo:~/Work/dists/launchpad/sourcecode/pygettextpo$ python ./test_gettextpo.py
.......E....
======================================================================
ERROR: Test that a translation with unicode chars is working.
----------------------------------------------------------------------
Traceback (most recent call last):
File "./test_gettextpo.py", line 115, in testUnicodeString
msg.set_msgid(u'Carlos Perell\xf3 Mar\xedn')
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 13: ordinal not in range(128)
----------------------------------------------------------------------
Ran 12 tests in 0.021s
I saw a problem with pygettextpo validation and thus I wrote a test to know if it was a problem with it or with Rosetta.
The test is: ng(self) : PoMessage( ) set_msgid( u'Carlos Perell\xf3 Mar\xedn') set_msgstr( u'Carlos Perell\xf3 Mar\xedn')
def testUnicodeStri
"""Test that a translation with unicode chars is working."""
msg = gettextpo.
msg.
msg.
And the test run output:
carlos@ frodo:~ /Work/dists/ launchpad/ sourcecode/ pygettextpo$ python ./test_gettextpo.py ======= ======= ======= ======= ======= ======= ======= ======= ======= ------- ------- ------- ------- ------- ------- ------- ------- ------- gettextpo. py", line 115, in testUnicodeString set_msgid( u'Carlos Perell\xf3 Mar\xedn')
.......E....
=======
ERROR: Test that a translation with unicode chars is working.
-------
Traceback (most recent call last):
File "./test_
msg.
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 13: ordinal not in range(128)
------- ------- ------- ------- ------- ------- ------- ------- ------- -------
Ran 12 tests in 0.021s
FAILED (errors=1)