Home | History | Annotate | Download | only in io

Lines Matching refs:code_point

899 static void AppendUTF8(uint32 code_point, string* output) {
902 if (code_point <= 0x7f) {
903 tmp = code_point;
905 } else if (code_point <= 0x07ff) {
907 ((code_point & 0x07c0) << 2) |
908 (code_point & 0x003f);
910 } else if (code_point <= 0xffff) {
912 ((code_point & 0xf000) << 4) |
913 ((code_point & 0x0fc0) << 2) |
914 (code_point & 0x003f);
916 } else if (code_point <= 0x1fffff) {
918 ((code_point & 0x1c0000) << 6) |
919 ((code_point & 0x03f000) << 4) |
920 ((code_point & 0x000fc0) << 2) |
921 (code_point & 0x003f);
926 StringAppendF(output, "\\U%08x", code_point);
955 static inline bool IsHeadSurrogate(uint32 code_point) {
956 return (code_point >= kMinHeadSurrogate) && (code_point < kMaxHeadSurrogate);
959 static inline bool IsTrailSurrogate(uint32 code_point) {
960 return (code_point >= kMinTrailSurrogate) &&
961 (code_point < kMaxTrailSurrogate);
981 // beyond that sequence, and fills in *code_point. On failure, returns ptr
983 static const char* FetchUnicodePoint(const char* ptr, uint32* code_point) {
987 if (!ReadHexDigits(p, len, code_point))
995 if (IsHeadSurrogate(*code_point) && *p == '\\' && *(p + 1) == 'u') {
999 *code_point = AssembleUTF16(*code_point, trail_surrogate);