Comment 0 for bug 404

Revision history for this message
Carlos Perelló Marín (carlos) wrote :

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

FAILED (errors=1)