File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616'London'
1717>>> str(area_description_for_number(de_number, "en"))
1818'Munich'
19- >>> u('M\xfc nchen ') == area_description_for_number(de_number, "de")
19+ >>> u('M\u00fc nchen ') == area_description_for_number(de_number, "de")
2020True
21- >>> u('Z\xfc rich ') == area_description_for_number(ch_number, "de")
21+ >>> u('Z\u00fc rich ') == area_description_for_number(ch_number, "de")
2222True
2323>>> str(area_description_for_number(ch_number, "en"))
2424'Zurich'
Original file line number Diff line number Diff line change 1616'Lu'
1717>>> unicode_util.Category.get(u2) == unicode_util.Category.LOWERCASE_LETTER
1818True
19- >>> beyond_bmp = u('\U00010100 ') # AEGEAN WORD SEPARATOR LINE
19+ >>> try:
20+ ... beyond_bmp = u('\U00010100 ') # AEGEAN WORD SEPARATOR LINE
21+ ... except Exception:
22+ ... beyond_bmp = u('')
2023>>> if len(beyond_bmp) == 1: # We have a UCS4 build of Python
2124... unicode_util.Category.get(beyond_bmp)
2225... else: # UCS2 build of Python; no non-BMP chars available
4851True
4952>>> unicode_util.Block.get(u('\u0860 ')) == unicode_util.Block.UNKNOWN
5053True
51- >>> beyond_bmp = u('\U00013430 ')
52- >>> if len(beyond_bmp) == 1: # We have a UCS4 build of Python
54+ >>> try:
55+ ... unknown_block = u('\U00013430 ')
56+ ... except Exception:
57+ ... unknown_block = u('')
58+ >>> if len(unknown_block) == 1: # We have a UCS4 build of Python
5359... unicode_util.Block.get(u('\U00013430 ')) == unicode_util.Block.UNKNOWN
5460... else: # UCS2 build of Python; no unknown characters available
5561... True
You can’t perform that action at this time.
0 commit comments