Lines Matching refs:ch
68 UTF32 ch; in ConvertUTF32toUTF16() local
72 ch = *source++; in ConvertUTF32toUTF16()
73 if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */ in ConvertUTF32toUTF16()
75 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF32toUTF16()
84 *target++ = (UTF16)ch; /* normal case */ in ConvertUTF32toUTF16()
86 } else if (ch > UNI_MAX_LEGAL_UTF32) { in ConvertUTF32toUTF16()
98 ch -= halfBase; in ConvertUTF32toUTF16()
99 *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START); in ConvertUTF32toUTF16()
100 *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START); in ConvertUTF32toUTF16()
116 UTF32 ch, ch2; in ConvertUTF16toUTF32() local
119 ch = *source++; in ConvertUTF16toUTF32()
121 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { in ConvertUTF16toUTF32()
127 ch = ((ch - UNI_SUR_HIGH_START) << halfShift) in ConvertUTF16toUTF32()
142 if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF16toUTF32()
152 *target++ = ch; in ConvertUTF16toUTF32()
158 fprintf(stderr, "ConvertUTF16toUTF32 illegal seq 0x%04x,%04x\n", ch, ch2); in ConvertUTF16toUTF32()
221 UTF32 ch; in ConvertUTF16toUTF8() local
226 ch = *source++; in ConvertUTF16toUTF8()
228 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { in ConvertUTF16toUTF8()
234 ch = ((ch - UNI_SUR_HIGH_START) << halfShift) in ConvertUTF16toUTF8()
249 if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF16toUTF8()
257 …if (ch && (ch != (UTF32)0x09) && (ch != (UTF32)0x0a) && (ch != (UTF32)0x0d) && (ch < (UTF32)0x2… in ConvertUTF16toUTF8()
258 ch = (UTF32)0x3f; in ConvertUTF16toUTF8()
261 if((ch == (UTF32)0xFEFF) || (ch == (UTF32)0xFFFE)|| (ch == (UTF32)0xFFFF)) { in ConvertUTF16toUTF8()
266 if (ch < (UTF32)0x80) { bytesToWrite = 1; in ConvertUTF16toUTF8()
267 } else if (ch < (UTF32)0x800) { bytesToWrite = 2; in ConvertUTF16toUTF8()
268 } else if (ch < (UTF32)0x10000) { bytesToWrite = 3; in ConvertUTF16toUTF8()
269 } else if (ch < (UTF32)0x110000) { bytesToWrite = 4; in ConvertUTF16toUTF8()
271 ch = UNI_REPLACEMENT_CHAR; in ConvertUTF16toUTF8()
280 case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; in ConvertUTF16toUTF8()
281 case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; in ConvertUTF16toUTF8()
282 case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; in ConvertUTF16toUTF8()
283 case 1: *--target = (UTF8)(ch | firstByteMark[bytesToWrite]); in ConvertUTF16toUTF8()
353 UTF32 ch = 0; in ConvertUTF8toUTF16() local
367 case 5: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ in ConvertUTF8toUTF16()
368 case 4: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ in ConvertUTF8toUTF16()
369 case 3: ch += *source++; ch <<= 6; in ConvertUTF8toUTF16()
370 case 2: ch += *source++; ch <<= 6; in ConvertUTF8toUTF16()
371 case 1: ch += *source++; ch <<= 6; in ConvertUTF8toUTF16()
372 case 0: ch += *source++; in ConvertUTF8toUTF16()
374 ch -= offsetsFromUTF8[extraBytesToRead]; in ConvertUTF8toUTF16()
380 if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */ in ConvertUTF8toUTF16()
382 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF8toUTF16()
391 *target++ = (UTF16)ch; /* normal case */ in ConvertUTF8toUTF16()
393 } else if (ch > UNI_MAX_UTF16) { in ConvertUTF8toUTF16()
407 ch -= halfBase; in ConvertUTF8toUTF16()
408 *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START); in ConvertUTF8toUTF16()
409 *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START); in ConvertUTF8toUTF16()
426 UTF32 ch; in ConvertUTF32toUTF8() local
430 ch = *source++; in ConvertUTF32toUTF8()
433 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF32toUTF8()
443 if (ch < (UTF32)0x80) { bytesToWrite = 1; in ConvertUTF32toUTF8()
444 } else if (ch < (UTF32)0x800) { bytesToWrite = 2; in ConvertUTF32toUTF8()
445 } else if (ch < (UTF32)0x10000) { bytesToWrite = 3; in ConvertUTF32toUTF8()
446 } else if (ch <= UNI_MAX_LEGAL_UTF32) { bytesToWrite = 4; in ConvertUTF32toUTF8()
448 ch = UNI_REPLACEMENT_CHAR; in ConvertUTF32toUTF8()
458 case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; in ConvertUTF32toUTF8()
459 case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; in ConvertUTF32toUTF8()
460 case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; in ConvertUTF32toUTF8()
461 case 1: *--target = (UTF8) (ch | firstByteMark[bytesToWrite]); in ConvertUTF32toUTF8()
479 UTF32 ch = 0; in ConvertUTF8toUTF32() local
493 case 5: ch += *source++; ch <<= 6; in ConvertUTF8toUTF32()
494 case 4: ch += *source++; ch <<= 6; in ConvertUTF8toUTF32()
495 case 3: ch += *source++; ch <<= 6; in ConvertUTF8toUTF32()
496 case 2: ch += *source++; ch <<= 6; in ConvertUTF8toUTF32()
497 case 1: ch += *source++; ch <<= 6; in ConvertUTF8toUTF32()
498 case 0: ch += *source++; in ConvertUTF8toUTF32()
500 ch -= offsetsFromUTF8[extraBytesToRead]; in ConvertUTF8toUTF32()
506 if (ch <= UNI_MAX_LEGAL_UTF32) { in ConvertUTF8toUTF32()
511 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF8toUTF32()
520 *target++ = ch; in ConvertUTF8toUTF32()