()
| 135 | |
| 136 | |
| 137 | def 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 | |
| 153 | def main_tw(): |
no test coverage detected
searching dependent graphs…