-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Open
Labels
unicodeRelated to unicode characters and encodingsRelated to unicode characters and encodings
Description
I sometimes want to use a function to get Unicode code point notation used in convention like U+0061 (Unicode 15.0, p.968) from Char. Such function is implemented in
Lines 331 to 339 in f942c29
| if isoverlong(c) | |
| print(io, "[overlong] ") | |
| u = decode_overlong(c) | |
| c = T(u) | |
| else | |
| u = codepoint(c) | |
| end | |
| h = uppercase(string(u, base = 16, pad = 4)) | |
| print(io, (isascii(c) ? "ASCII/" : ""), "Unicode U+", h) |
and it is easy to write:
unicode_code_point_notation(c::AbstractChar) = "U+" * uppercase(string(codepoint(c), base=16, pad=4))But I think it is good to have the function in module Unicode.
Metadata
Metadata
Assignees
Labels
unicodeRelated to unicode characters and encodingsRelated to unicode characters and encodings