Lines Matching refs:ch
89 UTF32 ch; in ConvertUTF32toUTF16() local
93 ch = *source++; in ConvertUTF32toUTF16()
94 if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */ in ConvertUTF32toUTF16()
96 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF32toUTF16()
105 *target++ = (UTF16)ch; /* normal case */ in ConvertUTF32toUTF16()
107 } else if (ch > UNI_MAX_LEGAL_UTF32) { in ConvertUTF32toUTF16()
119 ch -= halfBase; in ConvertUTF32toUTF16()
120 *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START); in ConvertUTF32toUTF16()
121 *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START); in ConvertUTF32toUTF16()
136 UTF32 ch, ch2; in ConvertUTF16toUTF32() local
139 ch = *source++; in ConvertUTF16toUTF32()
141 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { in ConvertUTF16toUTF32()
147 ch = ((ch - UNI_SUR_HIGH_START) << halfShift) in ConvertUTF16toUTF32()
162 if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF16toUTF32()
172 *target++ = ch; in ConvertUTF16toUTF32()
178 fprintf(stderr, "ConvertUTF16toUTF32 illegal seq 0x%04x,%04x\n", ch, ch2); in ConvertUTF16toUTF32()
244 UTF32 ch; in ConvertUTF16toUTF8() local
249 ch = *source++; in ConvertUTF16toUTF8()
251 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { in ConvertUTF16toUTF8()
257 ch = ((ch - UNI_SUR_HIGH_START) << halfShift) in ConvertUTF16toUTF8()
272 if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF16toUTF8()
279 if (ch < (UTF32)0x80) { bytesToWrite = 1; in ConvertUTF16toUTF8()
280 } else if (ch < (UTF32)0x800) { bytesToWrite = 2; in ConvertUTF16toUTF8()
281 } else if (ch < (UTF32)0x10000) { bytesToWrite = 3; in ConvertUTF16toUTF8()
282 } else if (ch < (UTF32)0x110000) { bytesToWrite = 4; in ConvertUTF16toUTF8()
284 ch = UNI_REPLACEMENT_CHAR; in ConvertUTF16toUTF8()
294 *--target = (UTF8)((ch | byteMark) & byteMask); in ConvertUTF16toUTF8()
295 ch >>= 6; in ConvertUTF16toUTF8()
298 *--target = (UTF8)((ch | byteMark) & byteMask); in ConvertUTF16toUTF8()
299 ch >>= 6; in ConvertUTF16toUTF8()
302 *--target = (UTF8)((ch | byteMark) & byteMask); in ConvertUTF16toUTF8()
303 ch >>= 6; in ConvertUTF16toUTF8()
306 *--target = (UTF8)(ch | firstByteMark[bytesToWrite]); in ConvertUTF16toUTF8()
383 UTF32 ch = 0; in ConvertUTF8toUTF16() local
398 case 5: ch += *source++; ch <<= 6; BP_FALLTHROUGH; in ConvertUTF8toUTF16()
400 case 4: ch += *source++; ch <<= 6; BP_FALLTHROUGH; in ConvertUTF8toUTF16()
401 case 3: ch += *source++; ch <<= 6; BP_FALLTHROUGH; in ConvertUTF8toUTF16()
402 case 2: ch += *source++; ch <<= 6; BP_FALLTHROUGH; in ConvertUTF8toUTF16()
403 case 1: ch += *source++; ch <<= 6; BP_FALLTHROUGH; in ConvertUTF8toUTF16()
404 case 0: ch += *source++; in ConvertUTF8toUTF16()
406 ch -= offsetsFromUTF8[extraBytesToRead]; in ConvertUTF8toUTF16()
412 if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */ in ConvertUTF8toUTF16()
414 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF8toUTF16()
423 *target++ = (UTF16)ch; /* normal case */ in ConvertUTF8toUTF16()
425 } else if (ch > UNI_MAX_UTF16) { in ConvertUTF8toUTF16()
439 ch -= halfBase; in ConvertUTF8toUTF16()
440 *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START); in ConvertUTF8toUTF16()
441 *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START); in ConvertUTF8toUTF16()
457 UTF32 ch; in ConvertUTF32toUTF8() local
461 ch = *source++; in ConvertUTF32toUTF8()
464 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF32toUTF8()
474 if (ch < (UTF32)0x80) { bytesToWrite = 1; in ConvertUTF32toUTF8()
475 } else if (ch < (UTF32)0x800) { bytesToWrite = 2; in ConvertUTF32toUTF8()
476 } else if (ch < (UTF32)0x10000) { bytesToWrite = 3; in ConvertUTF32toUTF8()
477 } else if (ch <= UNI_MAX_LEGAL_UTF32) { bytesToWrite = 4; in ConvertUTF32toUTF8()
479 ch = UNI_REPLACEMENT_CHAR; in ConvertUTF32toUTF8()
490 *--target = (UTF8)((ch | byteMark) & byteMask); in ConvertUTF32toUTF8()
491 ch >>= 6; in ConvertUTF32toUTF8()
494 *--target = (UTF8)((ch | byteMark) & byteMask); in ConvertUTF32toUTF8()
495 ch >>= 6; in ConvertUTF32toUTF8()
498 *--target = (UTF8)((ch | byteMark) & byteMask); in ConvertUTF32toUTF8()
499 ch >>= 6; in ConvertUTF32toUTF8()
502 *--target = (UTF8) (ch | firstByteMark[bytesToWrite]); in ConvertUTF32toUTF8()
519 UTF32 ch = 0; in ConvertUTF8toUTF32() local
533 case 5: ch += *source++; ch <<= 6; BP_FALLTHROUGH; in ConvertUTF8toUTF32()
534 case 4: ch += *source++; ch <<= 6; BP_FALLTHROUGH; in ConvertUTF8toUTF32()
535 case 3: ch += *source++; ch <<= 6; BP_FALLTHROUGH; in ConvertUTF8toUTF32()
536 case 2: ch += *source++; ch <<= 6; BP_FALLTHROUGH; in ConvertUTF8toUTF32()
537 case 1: ch += *source++; ch <<= 6; BP_FALLTHROUGH; in ConvertUTF8toUTF32()
538 case 0: ch += *source++; in ConvertUTF8toUTF32()
540 ch -= offsetsFromUTF8[extraBytesToRead]; in ConvertUTF8toUTF32()
546 if (ch <= UNI_MAX_LEGAL_UTF32) { in ConvertUTF8toUTF32()
551 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF8toUTF32()
560 *target++ = ch; in ConvertUTF8toUTF32()