Home | History | Annotate | Download | only in text

Lines Matching refs:sequence

89 static inline int decodeNonASCIISequence(const uint8_t* sequence, unsigned length)
91 ASSERT(!isASCII(sequence[0]));
93 ASSERT(sequence[0] <= 0xDF);
94 if (sequence[0] < 0xC2)
96 if (sequence[1] < 0x80 || sequence[1] > 0xBF)
98 return ((sequence[0] << 6) + sequence[1]) - 0x00003080;
101 ASSERT(sequence[0] >= 0xE0 && sequence[0] <= 0xEF);
102 switch (sequence[0]) {
104 if (sequence[1] < 0xA0 || sequence[1] > 0xBF)
108 if (sequence[1] < 0x80 || sequence[1] > 0x9F)
112 if (sequence[1] < 0x80 || sequence[1] > 0xBF)
115 if (sequence[2] < 0x80 || sequence[2] > 0xBF)
117 return ((sequence[0] << 12) + (sequence[1] << 6) + sequence[2]) - 0x000E2080;
120 ASSERT(sequence[0] >= 0xF0 && sequence[0] <= 0xF4);
121 switch (sequence[0]) {
123 if (sequence[1] < 0x90 || sequence[1] > 0xBF)
127 if (sequence[1] < 0x80 || sequence[1] > 0x8F)
131 if (sequence[1] < 0x80 || sequence[1] > 0xBF)
134 if (sequence[2] < 0x80 || sequence[2] > 0xBF)
136 if (sequence[3] < 0x80 || sequence[3] > 0xBF)
138 return ((sequence[0] << 18) + (sequence[1] << 12) + (sequence[2] << 6) + sequence[3]) - 0x03C82080;
187 // The new data is not enough to complete the sequence, so
188 // add it to the existing partial sequence.
193 // An incomplete partial sequence at the end is an error, but it will create
233 // The new data is not enough to complete the sequence, so
234 // add it to the existing partial sequence.
239 // An incomplete partial sequence at the end is an error.
267 // That includes all bytes in the partial-sequence buffer because
268 // each byte in an invalid sequence will turn into a replacement character.