Lines Matching refs:ch

88     UTF32 ch;  in ConvertUTF32toUTF16()  local
92 ch = *source++; in ConvertUTF32toUTF16()
93 if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */ in ConvertUTF32toUTF16()
95 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF32toUTF16()
104 *target++ = (UTF16)ch; /* normal case */ in ConvertUTF32toUTF16()
106 } else if (ch > UNI_MAX_LEGAL_UTF32) { in ConvertUTF32toUTF16()
118 ch -= halfBase; in ConvertUTF32toUTF16()
119 *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START); in ConvertUTF32toUTF16()
120 *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START); in ConvertUTF32toUTF16()
135 UTF32 ch, ch2; in ConvertUTF16toUTF32() local
138 ch = *source++; in ConvertUTF16toUTF32()
140 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { in ConvertUTF16toUTF32()
146 ch = ((ch - UNI_SUR_HIGH_START) << halfShift) in ConvertUTF16toUTF32()
161 if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF16toUTF32()
171 *target++ = ch; in ConvertUTF16toUTF32()
177 fprintf(stderr, "ConvertUTF16toUTF32 illegal seq 0x%04x,%04x\n", ch, ch2); in ConvertUTF16toUTF32()
239 UTF32 ch; in ConvertUTF16toUTF8() local
244 ch = *source++; in ConvertUTF16toUTF8()
246 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { in ConvertUTF16toUTF8()
252 ch = ((ch - UNI_SUR_HIGH_START) << halfShift) in ConvertUTF16toUTF8()
267 if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF16toUTF8()
274 if (ch < (UTF32)0x80) { bytesToWrite = 1; in ConvertUTF16toUTF8()
275 } else if (ch < (UTF32)0x800) { bytesToWrite = 2; in ConvertUTF16toUTF8()
276 } else if (ch < (UTF32)0x10000) { bytesToWrite = 3; in ConvertUTF16toUTF8()
277 } else if (ch < (UTF32)0x110000) { bytesToWrite = 4; in ConvertUTF16toUTF8()
279 ch = UNI_REPLACEMENT_CHAR; in ConvertUTF16toUTF8()
288 case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; in ConvertUTF16toUTF8()
289 case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; in ConvertUTF16toUTF8()
290 case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; in ConvertUTF16toUTF8()
291 case 1: *--target = (UTF8)(ch | firstByteMark[bytesToWrite]); in ConvertUTF16toUTF8()
360 UTF32 ch = 0; in ConvertUTF8toUTF16() local
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()
381 ch -= offsetsFromUTF8[extraBytesToRead]; in ConvertUTF8toUTF16()
387 if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */ in ConvertUTF8toUTF16()
389 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF8toUTF16()
398 *target++ = (UTF16)ch; /* normal case */ in ConvertUTF8toUTF16()
400 } else if (ch > UNI_MAX_UTF16) { in ConvertUTF8toUTF16()
414 ch -= halfBase; in ConvertUTF8toUTF16()
415 *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START); in ConvertUTF8toUTF16()
416 *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START); in ConvertUTF8toUTF16()
432 UTF32 ch; in ConvertUTF32toUTF8() local
436 ch = *source++; in ConvertUTF32toUTF8()
439 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF32toUTF8()
449 if (ch < (UTF32)0x80) { bytesToWrite = 1; in ConvertUTF32toUTF8()
450 } else if (ch < (UTF32)0x800) { bytesToWrite = 2; in ConvertUTF32toUTF8()
451 } else if (ch < (UTF32)0x10000) { bytesToWrite = 3; in ConvertUTF32toUTF8()
452 } else if (ch <= UNI_MAX_LEGAL_UTF32) { bytesToWrite = 4; in ConvertUTF32toUTF8()
454 ch = UNI_REPLACEMENT_CHAR; in ConvertUTF32toUTF8()
464 case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; in ConvertUTF32toUTF8()
465 case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; in ConvertUTF32toUTF8()
466 case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; in ConvertUTF32toUTF8()
467 case 1: *--target = (UTF8) (ch | firstByteMark[bytesToWrite]); in ConvertUTF32toUTF8()
484 UTF32 ch = 0; in ConvertUTF8toUTF32() local
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()
505 ch -= offsetsFromUTF8[extraBytesToRead]; in ConvertUTF8toUTF32()
511 if (ch <= UNI_MAX_LEGAL_UTF32) { in ConvertUTF8toUTF32()
516 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF8toUTF32()
525 *target++ = ch; in ConvertUTF8toUTF32()