def test_unicode_jp_from_bytes_comp_delimiter(self):
     """The example encoding without the escape sequence before '='"""
     pn = PersonNameUnicode(b'Yamada^Tarou='
                            b'\033$B;3ED\033(B^\033$BB@O:='
                            b'\033$B$d$^$@\033(B^\033$B$?$m$&\033(B',
                            [default_encoding, 'iso2022_jp'])
     if not in_py2:
         pn = pn.decode()
     assert (u'Yamada', u'Tarou') == (pn.family_name, pn.given_name)
     assert u'山田^太郎' == pn.ideographic
     assert u'やまだ^たろう' == pn.phonetic
 def test_unicode_jp_from_bytes_caret_delimiter(self):
     """PN: 3component in unicode works (Japanese)..."""
     # Example name from PS3.5-2008 section H  p. 98
     pn = PersonNameUnicode(b'Yamada^Tarou='
                            b'\033$B;3ED\033(B^\033$BB@O:\033(B='
                            b'\033$B$d$^$@\033(B^\033$B$?$m$&\033(B',
                            [default_encoding, 'iso2022_jp'])
     if not in_py2:
         pn = pn.decode()
     assert (u'Yamada', u'Tarou') == (pn.family_name, pn.given_name)
     assert u'山田^太郎' == pn.ideographic
     assert u'やまだ^たろう' == pn.phonetic
 def test_unicode_kr(self):
     """PN: 3component in unicode works (Korean)..."""
     # Example name from PS3.5-2008 section I.2 p. 101
     pn = PersonNameUnicode(b'Hong^Gildong='
                            b'\033$)C\373\363^\033$)C\321\316\324\327='
                            b'\033$)C\310\253^\033$)C\261\346\265\277',
                            [default_encoding, 'euc_kr'])
     # PersonNameUnicode and PersonName3 behave differently:
     # PersonName3 does not decode the components automatically
     if not in_py2:
         pn = pn.decode()
     assert (u'Hong', u'Gildong') == (pn.family_name, pn.given_name)
     assert u'洪^吉洞' == pn.ideographic
     assert u'홍^길동' == pn.phonetic