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