Lines Matching refs:source
85 const UTF32* source = *sourceStart; in ConvertUTF32toUTF16() local
87 while (source < sourceEnd) { in ConvertUTF32toUTF16()
92 ch = *source++; in ConvertUTF32toUTF16()
97 --source; /* return to the illegal value itself */ in ConvertUTF32toUTF16()
115 --source; /* Back up source pointer! */ in ConvertUTF32toUTF16()
123 *sourceStart = source; in ConvertUTF32toUTF16()
133 const UTF16* source = *sourceStart; in ConvertUTF16toUTF32() local
136 while (source < sourceEnd) { in ConvertUTF16toUTF32()
137 const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */ in ConvertUTF16toUTF32()
138 ch = *source++; in ConvertUTF16toUTF32()
142 if (source < sourceEnd) { in ConvertUTF16toUTF32()
143 ch2 = *source; in ConvertUTF16toUTF32()
148 ++source; in ConvertUTF16toUTF32()
150 --source; /* return to the illegal value itself */ in ConvertUTF16toUTF32()
155 --source; /* return to the high surrogate */ in ConvertUTF16toUTF32()
162 --source; /* return to the illegal value itself */ in ConvertUTF16toUTF32()
168 source = oldSource; /* Back up source pointer! */ in ConvertUTF16toUTF32()
173 *sourceStart = source; in ConvertUTF16toUTF32()
236 const UTF16* source = *sourceStart; in ConvertUTF16toUTF8() local
238 while (source < sourceEnd) { in ConvertUTF16toUTF8()
243 const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */ in ConvertUTF16toUTF8()
244 ch = *source++; in ConvertUTF16toUTF8()
248 if (source < sourceEnd) { in ConvertUTF16toUTF8()
249 UTF32 ch2 = *source; in ConvertUTF16toUTF8()
254 ++source; in ConvertUTF16toUTF8()
256 --source; /* return to the illegal value itself */ in ConvertUTF16toUTF8()
261 --source; /* return to the high surrogate */ in ConvertUTF16toUTF8()
268 --source; /* return to the illegal value itself */ in ConvertUTF16toUTF8()
284 source = oldSource; /* Back up source pointer! */ in ConvertUTF16toUTF8()
295 *sourceStart = source; in ConvertUTF16toUTF8()
313 static Boolean isLegalUTF8(const UTF8 *source, int length) { in isLegalUTF8() argument
315 const UTF8 *srcptr = source+length; in isLegalUTF8()
323 switch (*source) { in isLegalUTF8()
332 case 1: if (*source >= 0x80 && *source < 0xC2) return false; in isLegalUTF8()
334 if (*source > 0xF4) return false; in isLegalUTF8()
344 Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) { in isLegalUTF8Sequence() argument
345 int length = trailingBytesForUTF8[*source]+1; in isLegalUTF8Sequence()
346 if (source+length > sourceEnd) { in isLegalUTF8Sequence()
349 return isLegalUTF8(source, length); in isLegalUTF8Sequence()
357 const UTF8* source = *sourceStart; in ConvertUTF8toUTF16() local
359 while (source < sourceEnd) { in ConvertUTF8toUTF16()
361 unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; in ConvertUTF8toUTF16()
362 if (source + extraBytesToRead >= sourceEnd) { in ConvertUTF8toUTF16()
366 if (! isLegalUTF8(source, extraBytesToRead+1)) { in ConvertUTF8toUTF16()
374 case 5: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ in ConvertUTF8toUTF16()
375 case 4: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ in ConvertUTF8toUTF16()
376 case 3: ch += *source++; ch <<= 6; in ConvertUTF8toUTF16()
377 case 2: ch += *source++; ch <<= 6; in ConvertUTF8toUTF16()
378 case 1: ch += *source++; ch <<= 6; in ConvertUTF8toUTF16()
379 case 0: ch += *source++; in ConvertUTF8toUTF16()
384 source -= (extraBytesToRead+1); /* Back up source pointer! */ in ConvertUTF8toUTF16()
391 source -= (extraBytesToRead+1); /* return to the illegal value itself */ in ConvertUTF8toUTF16()
403 source -= (extraBytesToRead+1); /* return to the start */ in ConvertUTF8toUTF16()
411 source -= (extraBytesToRead+1); /* Back up source pointer! */ in ConvertUTF8toUTF16()
419 *sourceStart = source; in ConvertUTF8toUTF16()
429 const UTF32* source = *sourceStart; in ConvertUTF32toUTF8() local
431 while (source < sourceEnd) { in ConvertUTF32toUTF8()
436 ch = *source++; in ConvertUTF32toUTF8()
440 --source; /* return to the illegal value itself */ in ConvertUTF32toUTF8()
460 --source; /* Back up source pointer! */ in ConvertUTF32toUTF8()
471 *sourceStart = source; in ConvertUTF32toUTF8()
481 const UTF8* source = *sourceStart; in ConvertUTF8toUTF32() local
483 while (source < sourceEnd) { in ConvertUTF8toUTF32()
485 unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; in ConvertUTF8toUTF32()
486 if (source + extraBytesToRead >= sourceEnd) { in ConvertUTF8toUTF32()
490 if (! isLegalUTF8(source, extraBytesToRead+1)) { in ConvertUTF8toUTF32()
498 case 5: ch += *source++; ch <<= 6; in ConvertUTF8toUTF32()
499 case 4: ch += *source++; ch <<= 6; in ConvertUTF8toUTF32()
500 case 3: ch += *source++; ch <<= 6; in ConvertUTF8toUTF32()
501 case 2: ch += *source++; ch <<= 6; in ConvertUTF8toUTF32()
502 case 1: ch += *source++; ch <<= 6; in ConvertUTF8toUTF32()
503 case 0: ch += *source++; in ConvertUTF8toUTF32()
508 source -= (extraBytesToRead+1); /* Back up the source pointer! */ in ConvertUTF8toUTF32()
518 source -= (extraBytesToRead+1); /* return to the illegal value itself */ in ConvertUTF8toUTF32()
532 *sourceStart = source; in ConvertUTF8toUTF32()