Return all assigned/defined codepoints in Unicode.
(version: str = UNICODE_VERSION)
| 59 | return tree.getroot() |
| 60 | |
| 61 | def get_all_codepoints(version: str = UNICODE_VERSION) -> List[int]: |
| 62 | """Return all assigned/defined codepoints in Unicode.""" |
| 63 | root = get_unicode_xml_data(version) |
| 64 | ns = {"ucd": "http://www.unicode.org/ns/2003/ucd/1.0"} |
| 65 | codepoints = [] |
| 66 | for char in root.findall(".//ucd:char", ns): |
| 67 | cp_str = char.get("cp") |
| 68 | if cp_str: |
| 69 | codepoints.append(int(cp_str, 16)) |
| 70 | return sorted(codepoints) |
| 71 | |
| 72 | def parse_case_folding_file(filepath: str) -> Dict[int, bytes]: |
| 73 | """Parse Unicode CaseFolding.txt into a dict: codepoint -> folded UTF-8 bytes. |
nothing calls this directly
no test coverage detected
searching dependent graphs…