MCPcopy Create free account
hub / github.com/apache/brpc / IsValidCodepoint

Function IsValidCodepoint

src/butil/strings/utf_string_conversion_utils.h:15–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13namespace butil {
14
15inline 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
23inline bool IsValidCharacter(uint32_t code_point) {
24 // Excludes non-characters (U+FDD0..U+FDEF, and all codepoints ending in

Callers 2

ReadUnicodeCharacterFunction · 0.85
TruncateUTF8ToByteSizeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected