Lines Matching refs:ch
125 UTF32 ch; in ConvertUTF32toUTF16() local
129 ch = *source++; in ConvertUTF32toUTF16()
130 if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */ in ConvertUTF32toUTF16()
132 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF32toUTF16()
141 *target++ = (UTF16)ch; /* normal case */ in ConvertUTF32toUTF16()
143 } else if (ch > UNI_MAX_LEGAL_UTF32) { in ConvertUTF32toUTF16()
155 ch -= halfBase; in ConvertUTF32toUTF16()
156 *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START); in ConvertUTF32toUTF16()
157 *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START); in ConvertUTF32toUTF16()
173 UTF32 ch, ch2; in ConvertUTF16toUTF32() local
176 ch = *source++; in ConvertUTF16toUTF32()
178 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { in ConvertUTF16toUTF32()
184 ch = ((ch - UNI_SUR_HIGH_START) << halfShift) in ConvertUTF16toUTF32()
199 if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF16toUTF32()
209 *target++ = ch; in ConvertUTF16toUTF32()
215 fprintf(stderr, "ConvertUTF16toUTF32 illegal seq 0x%04x,%04x\n", ch, ch2); in ConvertUTF16toUTF32()
228 UTF32 ch; in ConvertUTF16toUTF8() local
233 ch = *source++; in ConvertUTF16toUTF8()
235 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { in ConvertUTF16toUTF8()
241 ch = ((ch - UNI_SUR_HIGH_START) << halfShift) in ConvertUTF16toUTF8()
256 if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF16toUTF8()
263 if (ch < (UTF32)0x80) { bytesToWrite = 1; in ConvertUTF16toUTF8()
264 } else if (ch < (UTF32)0x800) { bytesToWrite = 2; in ConvertUTF16toUTF8()
265 } else if (ch < (UTF32)0x10000) { bytesToWrite = 3; in ConvertUTF16toUTF8()
266 } else if (ch < (UTF32)0x110000) { bytesToWrite = 4; in ConvertUTF16toUTF8()
268 ch = UNI_REPLACEMENT_CHAR; in ConvertUTF16toUTF8()
277 case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; in ConvertUTF16toUTF8()
278 case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; in ConvertUTF16toUTF8()
279 case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; in ConvertUTF16toUTF8()
280 case 1: *--target = (UTF8)(ch | firstByteMark[bytesToWrite]); in ConvertUTF16toUTF8()
298 UTF32 ch; in ConvertUTF32toUTF8() local
302 ch = *source++; in ConvertUTF32toUTF8()
305 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF32toUTF8()
315 if (ch < (UTF32)0x80) { bytesToWrite = 1; in ConvertUTF32toUTF8()
316 } else if (ch < (UTF32)0x800) { bytesToWrite = 2; in ConvertUTF32toUTF8()
317 } else if (ch < (UTF32)0x10000) { bytesToWrite = 3; in ConvertUTF32toUTF8()
318 } else if (ch <= UNI_MAX_LEGAL_UTF32) { bytesToWrite = 4; in ConvertUTF32toUTF8()
320 ch = UNI_REPLACEMENT_CHAR; in ConvertUTF32toUTF8()
330 case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; in ConvertUTF32toUTF8()
331 case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; in ConvertUTF32toUTF8()
332 case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; in ConvertUTF32toUTF8()
333 case 1: *--target = (UTF8) (ch | firstByteMark[bytesToWrite]); in ConvertUTF32toUTF8()
522 UTF32 ch = 0; in ConvertUTF8toUTF16() local
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()
543 ch -= offsetsFromUTF8[extraBytesToRead]; in ConvertUTF8toUTF16()
549 if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */ in ConvertUTF8toUTF16()
551 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF8toUTF16()
560 *target++ = (UTF16)ch; /* normal case */ in ConvertUTF8toUTF16()
562 } else if (ch > UNI_MAX_UTF16) { in ConvertUTF8toUTF16()
576 ch -= halfBase; in ConvertUTF8toUTF16()
577 *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START); in ConvertUTF8toUTF16()
578 *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START); in ConvertUTF8toUTF16()
596 UTF32 ch = 0; in ConvertUTF8toUTF32Impl() local
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()
647 ch -= offsetsFromUTF8[extraBytesToRead]; in ConvertUTF8toUTF32Impl()
649 if (ch <= UNI_MAX_LEGAL_UTF32) { in ConvertUTF8toUTF32Impl()
654 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF8toUTF32Impl()
663 *target++ = ch; in ConvertUTF8toUTF32Impl()