Exemplo n.º 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
Exemplo n.º 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
Exemplo n.º 3
0
 def test_roundtrip_string(self):
     self.assertEqual(undouble_unicode_escape('foo'), 'foo')
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 7
0
 def test_object(self):
     NO_VALUE = object()
     self.assertEqual(undouble_unicode_escape(NO_VALUE), NO_VALUE)
Exemplo n.º 8
0
 def test_roundtrip_complex_unicode(self):
     goodname = u'Kılıçaslan'
     self.assertEqual(undouble_unicode_escape(goodname), goodname)
Exemplo n.º 9
0
 def test_encoded(self):
     garbled = u'K\u0131l\u0131\xe7aslan'
     goodname = u'Kılıçaslan'
     self.assertEqual(undouble_unicode_escape(garbled), goodname)
Exemplo n.º 10
0
 def test_roundtrip_string(self):
     self.assertEqual(undouble_unicode_escape('foo'), 'foo')
Exemplo n.º 11
0
 def test_roundtrip_simple_unicode(self):
     self.assertEqual(undouble_unicode_escape(u'foo'), u'foo')
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 14
0
 def test_object(self):
     NO_VALUE = object()
     self.assertEqual(undouble_unicode_escape(NO_VALUE), NO_VALUE)
Exemplo n.º 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)
Exemplo n.º 16
0
 def test_encoded(self):
     garbled = u'K\u0131l\u0131\xe7aslan'
     goodname = u'Kılıçaslan'
     self.assertEqual(undouble_unicode_escape(garbled), goodname)
Exemplo n.º 17
0
 def test_roundtrip_complex_unicode(self):
     goodname = u'Kılıçaslan'
     self.assertEqual(undouble_unicode_escape(goodname), goodname)
Exemplo n.º 18
0
 def test_roundtrip_simple_unicode(self):
     self.assertEqual(undouble_unicode_escape(u'foo'), u'foo')