Lines Matching refs:source
56 const UTF32* source = *sourceStart; in ConvertUTF32toUTF16() local
58 while (source < sourceEnd) { in ConvertUTF32toUTF16()
63 ch = *source++; in ConvertUTF32toUTF16()
68 --source; /* return to the illegal value itself */ in ConvertUTF32toUTF16()
86 --source; /* Back up source pointer! */ in ConvertUTF32toUTF16()
94 *sourceStart = source; in ConvertUTF32toUTF16()
105 const UTF16* source = *sourceStart; in ConvertUTF16toUTF32() local
108 while (source < sourceEnd) { in ConvertUTF16toUTF32()
109 const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */ in ConvertUTF16toUTF32()
110 ch = *source++; in ConvertUTF16toUTF32()
114 if (source < sourceEnd) { in ConvertUTF16toUTF32()
115 ch2 = *source; in ConvertUTF16toUTF32()
120 ++source; in ConvertUTF16toUTF32()
122 --source; /* return to the illegal value itself */ in ConvertUTF16toUTF32()
127 --source; /* return to the high surrogate */ in ConvertUTF16toUTF32()
134 --source; /* return to the illegal value itself */ in ConvertUTF16toUTF32()
140 source = oldSource; /* Back up source pointer! */ in ConvertUTF16toUTF32()
145 *sourceStart = source; in ConvertUTF16toUTF32()
209 const UTF16* source = *sourceStart; in ConvertUTF16toUTF8() local
211 while (source < sourceEnd) { in ConvertUTF16toUTF8()
216 const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */ in ConvertUTF16toUTF8()
217 ch = *source++; in ConvertUTF16toUTF8()
221 if (source < sourceEnd) { in ConvertUTF16toUTF8()
222 UTF32 ch2 = *source; in ConvertUTF16toUTF8()
227 ++source; in ConvertUTF16toUTF8()
229 --source; /* return to the illegal value itself */ in ConvertUTF16toUTF8()
234 --source; /* return to the high surrogate */ in ConvertUTF16toUTF8()
241 --source; /* return to the illegal value itself */ in ConvertUTF16toUTF8()
257 source = oldSource; /* Back up source pointer! */ in ConvertUTF16toUTF8()
268 *sourceStart = source; in ConvertUTF16toUTF8()
287 isLegalUTF8(const UTF8 *source, int length) { in isLegalUTF8() argument
289 const UTF8 *srcptr = source+length; in isLegalUTF8()
297 switch (*source) { in isLegalUTF8()
306 case 1: if (*source >= 0x80 && *source < 0xC2) return false; in isLegalUTF8()
308 if (*source > 0xF4) return false; in isLegalUTF8()
319 isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) { in isLegalUTF8Sequence() argument
320 int length = trailingBytesForUTF8[*source]+1; in isLegalUTF8Sequence()
321 if (source+length > sourceEnd) { in isLegalUTF8Sequence()
324 return isLegalUTF8(source, length); in isLegalUTF8Sequence()
333 const UTF8* source = *sourceStart; in ConvertUTF8toUTF16() local
335 while (source < sourceEnd) { in ConvertUTF8toUTF16()
337 unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; in ConvertUTF8toUTF16()
338 if (source + extraBytesToRead >= sourceEnd) { in ConvertUTF8toUTF16()
342 if (! isLegalUTF8(source, extraBytesToRead+1)) { in ConvertUTF8toUTF16()
350 case 5: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ in ConvertUTF8toUTF16()
351 case 4: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ in ConvertUTF8toUTF16()
352 case 3: ch += *source++; ch <<= 6; in ConvertUTF8toUTF16()
353 case 2: ch += *source++; ch <<= 6; in ConvertUTF8toUTF16()
354 case 1: ch += *source++; ch <<= 6; in ConvertUTF8toUTF16()
355 case 0: ch += *source++; in ConvertUTF8toUTF16()
360 source -= (extraBytesToRead+1); /* Back up source pointer! */ in ConvertUTF8toUTF16()
367 source -= (extraBytesToRead+1); /* return to the illegal value itself */ in ConvertUTF8toUTF16()
379 source -= (extraBytesToRead+1); /* return to the start */ in ConvertUTF8toUTF16()
387 source -= (extraBytesToRead+1); /* Back up source pointer! */ in ConvertUTF8toUTF16()
395 *sourceStart = source; in ConvertUTF8toUTF16()
406 const UTF32* source = *sourceStart; in ConvertUTF32toUTF8() local
408 while (source < sourceEnd) { in ConvertUTF32toUTF8()
413 ch = *source++; in ConvertUTF32toUTF8()
417 --source; /* return to the illegal value itself */ in ConvertUTF32toUTF8()
437 --source; /* Back up source pointer! */ in ConvertUTF32toUTF8()
448 *sourceStart = source; in ConvertUTF32toUTF8()
459 const UTF8* source = *sourceStart; in ConvertUTF8toUTF32() local
461 while (source < sourceEnd) { in ConvertUTF8toUTF32()
463 unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; in ConvertUTF8toUTF32()
464 if (source + extraBytesToRead >= sourceEnd) { in ConvertUTF8toUTF32()
468 if (! isLegalUTF8(source, extraBytesToRead+1)) { in ConvertUTF8toUTF32()
476 case 5: ch += *source++; ch <<= 6; in ConvertUTF8toUTF32()
477 case 4: ch += *source++; ch <<= 6; in ConvertUTF8toUTF32()
478 case 3: ch += *source++; ch <<= 6; in ConvertUTF8toUTF32()
479 case 2: ch += *source++; ch <<= 6; in ConvertUTF8toUTF32()
480 case 1: ch += *source++; ch <<= 6; in ConvertUTF8toUTF32()
481 case 0: ch += *source++; in ConvertUTF8toUTF32()
486 source -= (extraBytesToRead+1); /* Back up the source pointer! */ in ConvertUTF8toUTF32()
496 source -= (extraBytesToRead+1); /* return to the illegal value itself */ in ConvertUTF8toUTF32()
510 *sourceStart = source; in ConvertUTF8toUTF32()