Lines Matching refs:source
122 const UTF32* source = *sourceStart; in ConvertUTF32toUTF16() local
124 while (source < sourceEnd) { in ConvertUTF32toUTF16()
129 ch = *source++; in ConvertUTF32toUTF16()
134 --source; /* return to the illegal value itself */ in ConvertUTF32toUTF16()
152 --source; /* Back up source pointer! */ in ConvertUTF32toUTF16()
160 *sourceStart = source; in ConvertUTF32toUTF16()
171 const UTF16* source = *sourceStart; in ConvertUTF16toUTF32() local
174 while (source < sourceEnd) { in ConvertUTF16toUTF32()
175 … const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */ in ConvertUTF16toUTF32()
176 ch = *source++; in ConvertUTF16toUTF32()
180 if (source < sourceEnd) { in ConvertUTF16toUTF32()
181 ch2 = *source; in ConvertUTF16toUTF32()
186 ++source; in ConvertUTF16toUTF32()
188 --source; /* return to the illegal value itself */ in ConvertUTF16toUTF32()
193 --source; /* return to the high surrogate */ in ConvertUTF16toUTF32()
200 --source; /* return to the illegal value itself */ in ConvertUTF16toUTF32()
206 source = oldSource; /* Back up source pointer! */ in ConvertUTF16toUTF32()
211 *sourceStart = source; in ConvertUTF16toUTF32()
225 const UTF16* source = *sourceStart; in ConvertUTF16toUTF8() local
227 while (source < sourceEnd) { in ConvertUTF16toUTF8()
232 … const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */ in ConvertUTF16toUTF8()
233 ch = *source++; in ConvertUTF16toUTF8()
237 if (source < sourceEnd) { in ConvertUTF16toUTF8()
238 UTF32 ch2 = *source; in ConvertUTF16toUTF8()
243 ++source; in ConvertUTF16toUTF8()
245 --source; /* return to the illegal value itself */ in ConvertUTF16toUTF8()
250 --source; /* return to the high surrogate */ in ConvertUTF16toUTF8()
257 --source; /* return to the illegal value itself */ in ConvertUTF16toUTF8()
273 source = oldSource; /* Back up source pointer! */ in ConvertUTF16toUTF8()
284 *sourceStart = source; in ConvertUTF16toUTF8()
295 const UTF32* source = *sourceStart; in ConvertUTF32toUTF8() local
297 while (source < sourceEnd) { in ConvertUTF32toUTF8()
302 ch = *source++; in ConvertUTF32toUTF8()
306 --source; /* return to the illegal value itself */ in ConvertUTF32toUTF8()
326 --source; /* Back up source pointer! */ in ConvertUTF32toUTF8()
337 *sourceStart = source; in ConvertUTF32toUTF8()
355 static Boolean isLegalUTF8(const UTF8 *source, int length) { in isLegalUTF8() argument
357 const UTF8 *srcptr = source+length; in isLegalUTF8()
365 switch (*source) { in isLegalUTF8()
374 case 1: if (*source >= 0x80 && *source < 0xC2) return false; in isLegalUTF8()
376 if (*source > 0xF4) return false; in isLegalUTF8()
386 Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) { in isLegalUTF8Sequence() argument
387 int length = trailingBytesForUTF8[*source]+1; in isLegalUTF8Sequence()
388 if (length > sourceEnd - source) { in isLegalUTF8Sequence()
391 return isLegalUTF8(source, length); in isLegalUTF8Sequence()
397 findMaximalSubpartOfIllFormedUTF8Sequence(const UTF8 *source, in findMaximalSubpartOfIllFormedUTF8Sequence() argument
401 assert(!isLegalUTF8Sequence(source, sourceEnd)); in findMaximalSubpartOfIllFormedUTF8Sequence()
412 if (source == sourceEnd) in findMaximalSubpartOfIllFormedUTF8Sequence()
420 b1 = *source; in findMaximalSubpartOfIllFormedUTF8Sequence()
421 ++source; in findMaximalSubpartOfIllFormedUTF8Sequence()
430 if (source == sourceEnd) in findMaximalSubpartOfIllFormedUTF8Sequence()
433 b2 = *source; in findMaximalSubpartOfIllFormedUTF8Sequence()
434 ++source; in findMaximalSubpartOfIllFormedUTF8Sequence()
450 if (source == sourceEnd) in findMaximalSubpartOfIllFormedUTF8Sequence()
453 b3 = *source; in findMaximalSubpartOfIllFormedUTF8Sequence()
460 if (source == sourceEnd) in findMaximalSubpartOfIllFormedUTF8Sequence()
463 b3 = *source; in findMaximalSubpartOfIllFormedUTF8Sequence()
470 if (source == sourceEnd) in findMaximalSubpartOfIllFormedUTF8Sequence()
473 b3 = *source; in findMaximalSubpartOfIllFormedUTF8Sequence()
503 Boolean isLegalUTF8String(const UTF8 **source, const UTF8 *sourceEnd) { in isLegalUTF8String() argument
504 while (*source != sourceEnd) { in isLegalUTF8String()
505 int length = trailingBytesForUTF8[**source] + 1; in isLegalUTF8String()
506 if (length > sourceEnd - *source || !isLegalUTF8(*source, length)) in isLegalUTF8String()
508 *source += length; in isLegalUTF8String()
519 const UTF8* source = *sourceStart; in ConvertUTF8toUTF16() local
521 while (source < sourceEnd) { in ConvertUTF8toUTF16()
523 unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; in ConvertUTF8toUTF16()
524 if (extraBytesToRead >= sourceEnd - source) { in ConvertUTF8toUTF16()
528 if (!isLegalUTF8(source, extraBytesToRead+1)) { in ConvertUTF8toUTF16()
536 case 5: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ in ConvertUTF8toUTF16()
537 case 4: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ in ConvertUTF8toUTF16()
538 case 3: ch += *source++; ch <<= 6; in ConvertUTF8toUTF16()
539 case 2: ch += *source++; ch <<= 6; in ConvertUTF8toUTF16()
540 case 1: ch += *source++; ch <<= 6; in ConvertUTF8toUTF16()
541 case 0: ch += *source++; in ConvertUTF8toUTF16()
546 source -= (extraBytesToRead+1); /* Back up source pointer! */ in ConvertUTF8toUTF16()
553 source -= (extraBytesToRead+1); /* return to the illegal value itself */ in ConvertUTF8toUTF16()
565 source -= (extraBytesToRead+1); /* return to the start */ in ConvertUTF8toUTF16()
573 source -= (extraBytesToRead+1); /* Back up source pointer! */ in ConvertUTF8toUTF16()
581 *sourceStart = source; in ConvertUTF8toUTF16()
593 const UTF8* source = *sourceStart; in ConvertUTF8toUTF32Impl() local
595 while (source < sourceEnd) { in ConvertUTF8toUTF32Impl()
597 unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; in ConvertUTF8toUTF32Impl()
598 if (extraBytesToRead >= sourceEnd - source) { in ConvertUTF8toUTF32Impl()
609 source += findMaximalSubpartOfIllFormedUTF8Sequence(source, in ConvertUTF8toUTF32Impl()
620 if (!isLegalUTF8(source, extraBytesToRead+1)) { in ConvertUTF8toUTF32Impl()
630 source += findMaximalSubpartOfIllFormedUTF8Sequence(source, in ConvertUTF8toUTF32Impl()
640 case 5: ch += *source++; ch <<= 6; in ConvertUTF8toUTF32Impl()
641 case 4: ch += *source++; ch <<= 6; in ConvertUTF8toUTF32Impl()
642 case 3: ch += *source++; ch <<= 6; in ConvertUTF8toUTF32Impl()
643 case 2: ch += *source++; ch <<= 6; in ConvertUTF8toUTF32Impl()
644 case 1: ch += *source++; ch <<= 6; in ConvertUTF8toUTF32Impl()
645 case 0: ch += *source++; in ConvertUTF8toUTF32Impl()
656 source -= (extraBytesToRead+1); /* return to the illegal value itself */ in ConvertUTF8toUTF32Impl()
670 *sourceStart = source; in ConvertUTF8toUTF32Impl()