Lines Matching refs:ch
109 uint32_t ch, ch2 = 0; in ucnv_toUnicode_UTF8() local
119 ch = cnv->toUnicodeStatus;/*Stores the previously calculated ch from a previous call*/ in ucnv_toUnicode_UTF8()
127 ch = *(mySource++); in ucnv_toUnicode_UTF8()
128 if (ch < 0x80) /* Simple case */ in ucnv_toUnicode_UTF8()
130 *(myTarget++) = (UChar) ch; in ucnv_toUnicode_UTF8()
135 toUBytes[0] = (char)ch; in ucnv_toUnicode_UTF8()
136 inBytes = bytesFromUTF8[ch]; /* lookup current sequence length */ in ucnv_toUnicode_UTF8()
149 ch = (ch << 6) + ch2; in ucnv_toUnicode_UTF8()
156 cnv->toUnicodeStatus = ch; in ucnv_toUnicode_UTF8()
164 ch -= offsetsFromUTF8[inBytes]; in ucnv_toUnicode_UTF8()
178 if (i == inBytes && ch <= MAXIMUM_UTF && ch >= utf8_minChar32[i] && in ucnv_toUnicode_UTF8()
179 (isCESU8 ? i <= 3 : !U_IS_SURROGATE(ch))) in ucnv_toUnicode_UTF8()
182 if (ch <= MAXIMUM_UCS2) in ucnv_toUnicode_UTF8()
185 *(myTarget++) = (UChar) ch; in ucnv_toUnicode_UTF8()
190 ch -= HALF_BASE; in ucnv_toUnicode_UTF8()
191 *(myTarget++) = (UChar) ((ch >> HALF_SHIFT) + SURROGATE_HIGH_START); in ucnv_toUnicode_UTF8()
192 ch = (ch & HALF_MASK) + SURROGATE_LOW_START; in ucnv_toUnicode_UTF8()
195 *(myTarget++) = (UChar)ch; in ucnv_toUnicode_UTF8()
200 cnv->UCharErrorBuffer[0] = (UChar) ch; in ucnv_toUnicode_UTF8()
239 uint32_t ch, ch2 = 0; in ucnv_toUnicode_UTF8_OFFSETS_LOGIC() local
249 ch = cnv->toUnicodeStatus;/*Stores the previously calculated ch from a previous call*/ in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
256 ch = *(mySource++); in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
257 if (ch < 0x80) /* Simple case */ in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
259 *(myTarget++) = (UChar) ch; in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
264 toUBytes[0] = (char)ch; in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
265 inBytes = bytesFromUTF8[ch]; in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
278 ch = (ch << 6) + ch2; in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
284 cnv->toUnicodeStatus = ch; in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
292 ch -= offsetsFromUTF8[inBytes]; in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
306 if (i == inBytes && ch <= MAXIMUM_UTF && ch >= utf8_minChar32[i] && in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
307 (isCESU8 ? i <= 3 : !U_IS_SURROGATE(ch))) in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
310 if (ch <= MAXIMUM_UCS2) in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
313 *(myTarget++) = (UChar) ch; in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
319 ch -= HALF_BASE; in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
320 *(myTarget++) = (UChar) ((ch >> HALF_SHIFT) + SURROGATE_HIGH_START); in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
322 ch = (ch & HALF_MASK) + SURROGATE_LOW_START; in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
325 *(myTarget++) = (UChar)ch; in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
330 cnv->UCharErrorBuffer[0] = (UChar) ch; in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
366 UChar32 ch; in ucnv_fromUnicode_UTF8() local
373 ch = cnv->fromUChar32; in ucnv_fromUnicode_UTF8()
380 ch = *(mySource++); in ucnv_fromUnicode_UTF8()
382 if (ch < 0x80) /* Single byte */ in ucnv_fromUnicode_UTF8()
384 *(myTarget++) = (uint8_t) ch; in ucnv_fromUnicode_UTF8()
386 else if (ch < 0x800) /* Double byte */ in ucnv_fromUnicode_UTF8()
388 *(myTarget++) = (uint8_t) ((ch >> 6) | 0xc0); in ucnv_fromUnicode_UTF8()
391 *(myTarget++) = (uint8_t) ((ch & 0x3f) | 0x80); in ucnv_fromUnicode_UTF8()
395 cnv->charErrorBuffer[0] = (uint8_t) ((ch & 0x3f) | 0x80); in ucnv_fromUnicode_UTF8()
402 if(U16_IS_SURROGATE(ch) && isNotCESU8) { in ucnv_fromUnicode_UTF8()
406 if(U16_IS_SURROGATE_LEAD(ch) && U16_IS_TRAIL(*mySource)) { in ucnv_fromUnicode_UTF8()
408 ch=U16_GET_SUPPLEMENTARY(ch, *mySource); in ucnv_fromUnicode_UTF8()
415 cnv->fromUChar32 = ch; in ucnv_fromUnicode_UTF8()
422 cnv->fromUChar32 = ch; in ucnv_fromUnicode_UTF8()
431 if (ch <= MAXIMUM_UCS2) { in ucnv_fromUnicode_UTF8()
433 tempPtr[0] = (uint8_t) ((ch >> 12) | 0xe0); in ucnv_fromUnicode_UTF8()
437 tempPtr[0] = (uint8_t) ((ch >> 18) | 0xf0); in ucnv_fromUnicode_UTF8()
438 tempPtr[1] = (uint8_t) (((ch >> 12) & 0x3f) | 0x80); in ucnv_fromUnicode_UTF8()
440 tempPtr[indexToWrite-1] = (uint8_t) (((ch >> 6) & 0x3f) | 0x80); in ucnv_fromUnicode_UTF8()
441 tempPtr[indexToWrite] = (uint8_t) ((ch & 0x3f) | 0x80); in ucnv_fromUnicode_UTF8()
481 UChar32 ch; in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC() local
489 ch = cnv->fromUChar32; in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
500 ch = *(mySource++); in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
502 if (ch < 0x80) /* Single byte */ in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
505 *(myTarget++) = (char) ch; in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
507 else if (ch < 0x800) /* Double byte */ in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
510 *(myTarget++) = (uint8_t) ((ch >> 6) | 0xc0); in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
514 *(myTarget++) = (uint8_t) ((ch & 0x3f) | 0x80); in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
518 cnv->charErrorBuffer[0] = (uint8_t) ((ch & 0x3f) | 0x80); in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
528 if(U16_IS_SURROGATE(ch) && isNotCESU8) { in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
532 if(U16_IS_SURROGATE_LEAD(ch) && U16_IS_TRAIL(*mySource)) { in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
534 ch=U16_GET_SUPPLEMENTARY(ch, *mySource); in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
542 cnv->fromUChar32 = ch; in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
549 cnv->fromUChar32 = ch; in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
558 if (ch <= MAXIMUM_UCS2) { in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
560 tempPtr[0] = (uint8_t) ((ch >> 12) | 0xe0); in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
564 tempPtr[0] = (uint8_t) ((ch >> 18) | 0xf0); in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
565 tempPtr[1] = (uint8_t) (((ch >> 12) & 0x3f) | 0x80); in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
567 tempPtr[indexToWrite-1] = (uint8_t) (((ch >> 6) & 0x3f) | 0x80); in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
568 tempPtr[indexToWrite] = (uint8_t) ((ch & 0x3f) | 0x80); in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
617 UChar32 ch; in ucnv_getNextUChar_UTF8() local
670 ch = myByte << 6; in ucnv_getNextUChar_UTF8()
675 ch += (myByte = *source); in ucnv_getNextUChar_UTF8()
676 ch <<= 6; in ucnv_getNextUChar_UTF8()
684 ch += (myByte = *source); in ucnv_getNextUChar_UTF8()
685 ch <<= 6; in ucnv_getNextUChar_UTF8()
693 ch += (myByte = *source); in ucnv_getNextUChar_UTF8()
694 ch <<= 6; in ucnv_getNextUChar_UTF8()
702 ch += (myByte = *source); in ucnv_getNextUChar_UTF8()
703 ch <<= 6; in ucnv_getNextUChar_UTF8()
711 ch += (myByte = *source); in ucnv_getNextUChar_UTF8()
719 ch -= offsetsFromUTF8[extraBytesToWrite]; in ucnv_getNextUChar_UTF8()
734 (uint32_t)ch <= MAXIMUM_UTF && in ucnv_getNextUChar_UTF8()
735 (uint32_t)ch >= utf8_minChar32[extraBytesToWrite] && in ucnv_getNextUChar_UTF8()
736 !U_IS_SURROGATE(ch) in ucnv_getNextUChar_UTF8()
738 return ch; /* return the code point */ in ucnv_getNextUChar_UTF8()