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)

Python's sad Unicode support strikes again. How did you get your copy of Python? Apple?

The script works on Python 2.7.12 shipped on Ubuntu 16.04. Debian and, therefore, Ubuntu ships wide Python. It seems that Travis also runs Ubuntu, so it should be OK there.

@annevk, Is making the script work on e.g. Apple-shipped Python a blocker for merging?

-- 
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 13:55:08 UTC