491
edits
(Split noncharacter per request) |
m (1 revision imported) |
||
Line 126: | Line 126: | ||
--]] | --]] | ||
function p. | -- https://www.unicode.org/versions/Unicode11.0.0/ch04.pdf, section 4.8 | ||
function p.lookup_name(codepoint) | |||
-- U+FDD0-U+FDEF and all code points ending in FFFE or FFFF are Unassigned | -- U+FDD0-U+FDEF and all code points ending in FFFE or FFFF are Unassigned | ||
-- (Cn) and specifically noncharacters: | -- (Cn) and specifically noncharacters: | ||
-- https://www.unicode.org/faq/private_use.html#nonchar4 | -- https://www.unicode.org/faq/private_use.html#nonchar4 | ||
if 0xFDD0 <= codepoint and (codepoint <= 0xFDEF | |||
or floor(codepoint % 0x10000) >= 0xFFFE | or floor(codepoint % 0x10000) >= 0xFFFE) then | ||
return ("<noncharacter-%04X>"):format(codepoint) | return ("<noncharacter-%04X>"):format(codepoint) | ||
end | end |