Re: [whatwg/encoding] Non-normatively visualize the indexes (#89)

hsivonen commented on this pull request.



> +        label += ", Unified Ideograph"
+    elif code_point >= 0xAC00 and code_point <= 0xD7AF:
+        label += ", Hangul"
+    if contiguous:
+        label += ", contiguous"
+    if duplicate:
+        label += ", duplicate"
+    return label
+
+
+def format_code_point(code_point):
+    if code_point >= 0x80 and code_point < 0xA0:
+        # HTML prohibits C1 controls
+        # TODO draw some fancy SVG hex inside the square
+        return "<svg><rect x=1 y=1 width=14 height=14 stroke=black stroke-width=2 fill=none /></svg>"
+    as_str = unichr(code_point)

> If the issue is literally just `unichr`, then it is at least easily worked around. 

Yeah, I guess tomorrow I'll be writing the wrapper (Unicode string for code point regardless of 16 vs. 32-bit units) that Python should have had the good sense to put in the standard library.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/encoding/pull/89

Received on Tuesday, 17 January 2017 19:12:33 UTC