MCPcopy Index your code
hub / github.com/python/cpython / load_cp950_map

Function load_cp950_map

Tools/unicode/genmap_tchinese.py:137–150  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

135
136
137def load_cp950_map():
138 mapfile = open_mapping_file('python-mappings/CP950.TXT', MAPPINGS_CP950)
139 with mapfile:
140 cp950decmap = loadmap(mapfile)
141 cp950encmap = {}
142 for c1, m in list(cp950decmap.items()):
143 for c2, code in list(m.items()):
144 cp950encmap.setdefault(code >> 8, {})
145 if code & 0xff not in cp950encmap[code >> 8]:
146 cp950encmap[code >> 8][code & 0xff] = c1 << 8 | c2
147 # fix unicode->big5 duplicated mapping priority
148 cp950encmap[0x53][0x41] = 0xA451
149 cp950encmap[0x53][0x45] = 0xA4CA
150 return cp950decmap, cp950encmap
151
152
153def main_tw():

Callers 1

main_twFunction · 0.85

Calls 5

open_mapping_fileFunction · 0.85
loadmapFunction · 0.85
listClass · 0.85
itemsMethod · 0.45
setdefaultMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…