Lines Matching refs:ch

151         UTF32 ch;  in ConvertUTF32toUTF16()  local
155 ch = *source++; in ConvertUTF32toUTF16()
156 if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */ in ConvertUTF32toUTF16()
158 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF32toUTF16()
167 *target++ = (UTF16)ch; /* normal case */ in ConvertUTF32toUTF16()
169 } else if (ch > UNI_MAX_LEGAL_UTF32) { in ConvertUTF32toUTF16()
181 ch -= halfBase; in ConvertUTF32toUTF16()
182 *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START); in ConvertUTF32toUTF16()
183 *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START); in ConvertUTF32toUTF16()
199 UTF32 ch, ch2; in ConvertUTF16toUTF32() local
202 ch = *source++; in ConvertUTF16toUTF32()
204 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { in ConvertUTF16toUTF32()
210 ch = ((ch - UNI_SUR_HIGH_START) << halfShift) in ConvertUTF16toUTF32()
225 if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF16toUTF32()
235 *target++ = ch; in ConvertUTF16toUTF32()
241 fprintf(stderr, "ConvertUTF16toUTF32 illegal seq 0x%04x,%04x\n", ch, ch2); in ConvertUTF16toUTF32()
254 UTF32 ch; in ConvertUTF16toUTF8() local
259 ch = *source++; in ConvertUTF16toUTF8()
261 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { in ConvertUTF16toUTF8()
267 ch = ((ch - UNI_SUR_HIGH_START) << halfShift) in ConvertUTF16toUTF8()
282 if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF16toUTF8()
289 if (ch < (UTF32)0x80) { bytesToWrite = 1; in ConvertUTF16toUTF8()
290 } else if (ch < (UTF32)0x800) { bytesToWrite = 2; in ConvertUTF16toUTF8()
291 } else if (ch < (UTF32)0x10000) { bytesToWrite = 3; in ConvertUTF16toUTF8()
292 } else if (ch < (UTF32)0x110000) { bytesToWrite = 4; in ConvertUTF16toUTF8()
294 ch = UNI_REPLACEMENT_CHAR; in ConvertUTF16toUTF8()
303 case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; in ConvertUTF16toUTF8()
304 case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; in ConvertUTF16toUTF8()
305 case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; in ConvertUTF16toUTF8()
306 case 1: *--target = (UTF8)(ch | firstByteMark[bytesToWrite]); in ConvertUTF16toUTF8()
324 UTF32 ch; in ConvertUTF32toUTF8() local
328 ch = *source++; in ConvertUTF32toUTF8()
331 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF32toUTF8()
341 if (ch < (UTF32)0x80) { bytesToWrite = 1; in ConvertUTF32toUTF8()
342 } else if (ch < (UTF32)0x800) { bytesToWrite = 2; in ConvertUTF32toUTF8()
343 } else if (ch < (UTF32)0x10000) { bytesToWrite = 3; in ConvertUTF32toUTF8()
344 } else if (ch <= UNI_MAX_LEGAL_UTF32) { bytesToWrite = 4; in ConvertUTF32toUTF8()
346 ch = UNI_REPLACEMENT_CHAR; in ConvertUTF32toUTF8()
356 case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; in ConvertUTF32toUTF8()
357 case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; in ConvertUTF32toUTF8()
358 case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; in ConvertUTF32toUTF8()
359 case 1: *--target = (UTF8) (ch | firstByteMark[bytesToWrite]); in ConvertUTF32toUTF8()
548 UTF32 ch = 0; in ConvertUTF8toUTF16() local
562 case 5: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ in ConvertUTF8toUTF16()
563 case 4: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ in ConvertUTF8toUTF16()
564 case 3: ch += *source++; ch <<= 6; in ConvertUTF8toUTF16()
565 case 2: ch += *source++; ch <<= 6; in ConvertUTF8toUTF16()
566 case 1: ch += *source++; ch <<= 6; in ConvertUTF8toUTF16()
567 case 0: ch += *source++; in ConvertUTF8toUTF16()
569 ch -= offsetsFromUTF8[extraBytesToRead]; in ConvertUTF8toUTF16()
575 if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */ in ConvertUTF8toUTF16()
577 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF8toUTF16()
586 *target++ = (UTF16)ch; /* normal case */ in ConvertUTF8toUTF16()
588 } else if (ch > UNI_MAX_UTF16) { in ConvertUTF8toUTF16()
602 ch -= halfBase; in ConvertUTF8toUTF16()
603 *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START); in ConvertUTF8toUTF16()
604 *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START); in ConvertUTF8toUTF16()
622 UTF32 ch = 0; in ConvertUTF8toUTF32Impl() local
666 case 5: ch += *source++; ch <<= 6; in ConvertUTF8toUTF32Impl()
667 case 4: ch += *source++; ch <<= 6; in ConvertUTF8toUTF32Impl()
668 case 3: ch += *source++; ch <<= 6; in ConvertUTF8toUTF32Impl()
669 case 2: ch += *source++; ch <<= 6; in ConvertUTF8toUTF32Impl()
670 case 1: ch += *source++; ch <<= 6; in ConvertUTF8toUTF32Impl()
671 case 0: ch += *source++; in ConvertUTF8toUTF32Impl()
673 ch -= offsetsFromUTF8[extraBytesToRead]; in ConvertUTF8toUTF32Impl()
675 if (ch <= UNI_MAX_LEGAL_UTF32) { in ConvertUTF8toUTF32Impl()
680 if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { in ConvertUTF8toUTF32Impl()
689 *target++ = ch; in ConvertUTF8toUTF32Impl()