| 13 | namespace butil { |
| 14 | |
| 15 | inline bool IsValidCodepoint(uint32_t code_point) { |
| 16 | // Excludes the surrogate code points ([0xD800, 0xDFFF]) and |
| 17 | // codepoints larger than 0x10FFFF (the highest codepoint allowed). |
| 18 | // Non-characters and unassigned codepoints are allowed. |
| 19 | return code_point < 0xD800u || |
| 20 | (code_point >= 0xE000u && code_point <= 0x10FFFFu); |
| 21 | } |
| 22 | |
| 23 | inline bool IsValidCharacter(uint32_t code_point) { |
| 24 | // Excludes non-characters (U+FDD0..U+FDEF, and all codepoints ending in |
no outgoing calls
no test coverage detected