MCPcopy Create free account
hub / github.com/ashvardanian/StringZilla / get_all_codepoints

Function get_all_codepoints

scripts/test_helpers.py:61–70  ·  view source on GitHub ↗

Return all assigned/defined codepoints in Unicode.

(version: str = UNICODE_VERSION)

Source from the content-addressed store, hash-verified

59 return tree.getroot()
60
61def 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
72def parse_case_folding_file(filepath: str) -> Dict[int, bytes]:
73 """Parse Unicode CaseFolding.txt into a dict: codepoint -> folded UTF-8 bytes.

Callers

nothing calls this directly

Calls 1

get_unicode_xml_dataFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…