Example #1
0
 def __init__(
         self, msgid, msgstr='',
         references=[], automatic_comments=[], comments=[]):
     """Build a MessageEntry.
     """
     self.msgid = msgid
     self.msgstr = undouble_unicode_escape(msgstr)
     self.references = references
     self.automatic_comments = automatic_comments
     self.comments = comments
Example #2
0
 def __init__(
         self, msgid, msgstr='',
         references=[], automatic_comments=[], comments=[]):
     """Build a MessageEntry.
     """
     self.msgid = msgid
     self.msgstr = undouble_unicode_escape(msgstr)
     self.references = references
     self.automatic_comments = automatic_comments
     self.comments = comments
Example #3
0
 def test_roundtrip_string(self):
     self.assertEqual(undouble_unicode_escape('foo'), 'foo')
Example #4
0
 def test_encoded_escaped_kili(self):
     garbled = 'K\\u0131l\\u0131\xe7aslan'  # actually: bytes
     goodname = u'Kılıçaslan'
     self.assertEqual(undouble_unicode_escape(garbled), goodname)
Example #5
0
 def test_encoded_escaped_seen_in_wild(self):
     garbled = 'msgstr "Polo\\u017eka ${title} byla odstran\\u011bna."'
     goodname = u'msgstr "Položka ${title} byla odstraněna."'
     self.assertEqual(undouble_unicode_escape(garbled), goodname)
Example #6
0
 def test_triple_encoded(self):
     garbled = 'K\xc3\x84\xc2\xb1l\xc3\x84\xc2\xb1\xc3\x83\xc2\xa7aslan'
     goodname = u'Kılıçaslan'
     self.assertEqual(undouble_unicode_escape(garbled), goodname)
Example #7
0
 def test_object(self):
     NO_VALUE = object()
     self.assertEqual(undouble_unicode_escape(NO_VALUE), NO_VALUE)
Example #8
0
 def test_roundtrip_complex_unicode(self):
     goodname = u'Kılıçaslan'
     self.assertEqual(undouble_unicode_escape(goodname), goodname)
Example #9
0
 def test_encoded(self):
     garbled = u'K\u0131l\u0131\xe7aslan'
     goodname = u'Kılıçaslan'
     self.assertEqual(undouble_unicode_escape(garbled), goodname)
Example #10
0
 def test_roundtrip_string(self):
     self.assertEqual(undouble_unicode_escape('foo'), 'foo')
Example #11
0
 def test_roundtrip_simple_unicode(self):
     self.assertEqual(undouble_unicode_escape(u'foo'), u'foo')
Example #12
0
 def test_encoded_escaped_kili(self):
     garbled = 'K\\u0131l\\u0131\xe7aslan'  # actually: bytes
     goodname = u'Kılıçaslan'
     self.assertEqual(undouble_unicode_escape(garbled), goodname)
Example #13
0
 def test_encoded_escaped_seen_in_wild(self):
     garbled = 'msgstr "Polo\\u017eka ${title} byla odstran\\u011bna."'
     goodname = u'msgstr "Položka ${title} byla odstraněna."'
     self.assertEqual(undouble_unicode_escape(garbled), goodname)
Example #14
0
 def test_object(self):
     NO_VALUE = object()
     self.assertEqual(undouble_unicode_escape(NO_VALUE), NO_VALUE)
Example #15
0
 def test_triple_encoded(self):
     garbled = 'K\xc3\x84\xc2\xb1l\xc3\x84\xc2\xb1\xc3\x83\xc2\xa7aslan'
     goodname = u'Kılıçaslan'
     self.assertEqual(undouble_unicode_escape(garbled), goodname)
Example #16
0
 def test_encoded(self):
     garbled = u'K\u0131l\u0131\xe7aslan'
     goodname = u'Kılıçaslan'
     self.assertEqual(undouble_unicode_escape(garbled), goodname)
Example #17
0
 def test_roundtrip_complex_unicode(self):
     goodname = u'Kılıçaslan'
     self.assertEqual(undouble_unicode_escape(goodname), goodname)
Example #18
0
 def test_roundtrip_simple_unicode(self):
     self.assertEqual(undouble_unicode_escape(u'foo'), u'foo')