Lines Matching refs:ch
100 uint32_t ch, ch2 = 0; in ucnv_toUnicode_UTF8() local
110 ch = cnv->toUnicodeStatus;/*Stores the previously calculated ch from a previous call*/ in ucnv_toUnicode_UTF8()
118 ch = *(mySource++); in ucnv_toUnicode_UTF8()
119 if (ch < 0x80) /* Simple case */ in ucnv_toUnicode_UTF8()
121 *(myTarget++) = (UChar) ch; in ucnv_toUnicode_UTF8()
126 toUBytes[0] = (char)ch; in ucnv_toUnicode_UTF8()
127 inBytes = bytesFromUTF8[ch]; /* lookup current sequence length */ in ucnv_toUnicode_UTF8()
140 ch = (ch << 6) + ch2; in ucnv_toUnicode_UTF8()
147 cnv->toUnicodeStatus = ch; in ucnv_toUnicode_UTF8()
155 ch -= offsetsFromUTF8[inBytes]; in ucnv_toUnicode_UTF8()
169 if (i == inBytes && ch <= MAXIMUM_UTF && ch >= utf8_minChar32[i] && in ucnv_toUnicode_UTF8()
170 (isCESU8 ? i <= 3 : !U_IS_SURROGATE(ch))) in ucnv_toUnicode_UTF8()
173 if (ch <= MAXIMUM_UCS2) in ucnv_toUnicode_UTF8()
176 *(myTarget++) = (UChar) ch; in ucnv_toUnicode_UTF8()
181 ch -= HALF_BASE; in ucnv_toUnicode_UTF8()
182 *(myTarget++) = (UChar) ((ch >> HALF_SHIFT) + SURROGATE_HIGH_START); in ucnv_toUnicode_UTF8()
183 ch = (ch & HALF_MASK) + SURROGATE_LOW_START; in ucnv_toUnicode_UTF8()
186 *(myTarget++) = (UChar)ch; in ucnv_toUnicode_UTF8()
191 cnv->UCharErrorBuffer[0] = (UChar) ch; in ucnv_toUnicode_UTF8()
230 uint32_t ch, ch2 = 0; in ucnv_toUnicode_UTF8_OFFSETS_LOGIC() local
240 ch = cnv->toUnicodeStatus;/*Stores the previously calculated ch from a previous call*/ in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
247 ch = *(mySource++); in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
248 if (ch < 0x80) /* Simple case */ in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
250 *(myTarget++) = (UChar) ch; in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
255 toUBytes[0] = (char)ch; in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
256 inBytes = bytesFromUTF8[ch]; in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
269 ch = (ch << 6) + ch2; in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
275 cnv->toUnicodeStatus = ch; in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
283 ch -= offsetsFromUTF8[inBytes]; in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
297 if (i == inBytes && ch <= MAXIMUM_UTF && ch >= utf8_minChar32[i] && in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
298 (isCESU8 ? i <= 3 : !U_IS_SURROGATE(ch))) in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
301 if (ch <= MAXIMUM_UCS2) in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
304 *(myTarget++) = (UChar) ch; in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
310 ch -= HALF_BASE; in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
311 *(myTarget++) = (UChar) ((ch >> HALF_SHIFT) + SURROGATE_HIGH_START); in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
313 ch = (ch & HALF_MASK) + SURROGATE_LOW_START; in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
316 *(myTarget++) = (UChar)ch; in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
321 cnv->UCharErrorBuffer[0] = (UChar) ch; in ucnv_toUnicode_UTF8_OFFSETS_LOGIC()
357 UChar32 ch; in ucnv_fromUnicode_UTF8() local
364 ch = cnv->fromUChar32; in ucnv_fromUnicode_UTF8()
371 ch = *(mySource++); in ucnv_fromUnicode_UTF8()
373 if (ch < 0x80) /* Single byte */ in ucnv_fromUnicode_UTF8()
375 *(myTarget++) = (uint8_t) ch; in ucnv_fromUnicode_UTF8()
377 else if (ch < 0x800) /* Double byte */ in ucnv_fromUnicode_UTF8()
379 *(myTarget++) = (uint8_t) ((ch >> 6) | 0xc0); in ucnv_fromUnicode_UTF8()
382 *(myTarget++) = (uint8_t) ((ch & 0x3f) | 0x80); in ucnv_fromUnicode_UTF8()
386 cnv->charErrorBuffer[0] = (uint8_t) ((ch & 0x3f) | 0x80); in ucnv_fromUnicode_UTF8()
393 if(U16_IS_SURROGATE(ch) && isNotCESU8) { in ucnv_fromUnicode_UTF8()
397 if(U16_IS_SURROGATE_LEAD(ch) && U16_IS_TRAIL(*mySource)) { in ucnv_fromUnicode_UTF8()
399 ch=U16_GET_SUPPLEMENTARY(ch, *mySource); in ucnv_fromUnicode_UTF8()
406 cnv->fromUChar32 = ch; in ucnv_fromUnicode_UTF8()
413 cnv->fromUChar32 = ch; in ucnv_fromUnicode_UTF8()
422 if (ch <= MAXIMUM_UCS2) { in ucnv_fromUnicode_UTF8()
424 tempPtr[0] = (uint8_t) ((ch >> 12) | 0xe0); in ucnv_fromUnicode_UTF8()
428 tempPtr[0] = (uint8_t) ((ch >> 18) | 0xf0); in ucnv_fromUnicode_UTF8()
429 tempPtr[1] = (uint8_t) (((ch >> 12) & 0x3f) | 0x80); in ucnv_fromUnicode_UTF8()
431 tempPtr[indexToWrite-1] = (uint8_t) (((ch >> 6) & 0x3f) | 0x80); in ucnv_fromUnicode_UTF8()
432 tempPtr[indexToWrite] = (uint8_t) ((ch & 0x3f) | 0x80); in ucnv_fromUnicode_UTF8()
472 UChar32 ch; in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC() local
480 ch = cnv->fromUChar32; in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
491 ch = *(mySource++); in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
493 if (ch < 0x80) /* Single byte */ in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
496 *(myTarget++) = (char) ch; in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
498 else if (ch < 0x800) /* Double byte */ in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
501 *(myTarget++) = (uint8_t) ((ch >> 6) | 0xc0); in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
505 *(myTarget++) = (uint8_t) ((ch & 0x3f) | 0x80); in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
509 cnv->charErrorBuffer[0] = (uint8_t) ((ch & 0x3f) | 0x80); in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
519 if(U16_IS_SURROGATE(ch) && isNotCESU8) { in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
523 if(U16_IS_SURROGATE_LEAD(ch) && U16_IS_TRAIL(*mySource)) { in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
525 ch=U16_GET_SUPPLEMENTARY(ch, *mySource); in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
533 cnv->fromUChar32 = ch; in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
540 cnv->fromUChar32 = ch; in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
549 if (ch <= MAXIMUM_UCS2) { in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
551 tempPtr[0] = (uint8_t) ((ch >> 12) | 0xe0); in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
555 tempPtr[0] = (uint8_t) ((ch >> 18) | 0xf0); in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
556 tempPtr[1] = (uint8_t) (((ch >> 12) & 0x3f) | 0x80); in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
558 tempPtr[indexToWrite-1] = (uint8_t) (((ch >> 6) & 0x3f) | 0x80); in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
559 tempPtr[indexToWrite] = (uint8_t) ((ch & 0x3f) | 0x80); in ucnv_fromUnicode_UTF8_OFFSETS_LOGIC()
608 UChar32 ch; in ucnv_getNextUChar_UTF8() local
661 ch = myByte << 6; in ucnv_getNextUChar_UTF8()
666 ch += (myByte = *source); in ucnv_getNextUChar_UTF8()
667 ch <<= 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()
710 ch -= offsetsFromUTF8[extraBytesToWrite]; in ucnv_getNextUChar_UTF8()
725 (uint32_t)ch <= MAXIMUM_UTF && in ucnv_getNextUChar_UTF8()
726 (uint32_t)ch >= utf8_minChar32[extraBytesToWrite] && in ucnv_getNextUChar_UTF8()
727 !U_IS_SURROGATE(ch) in ucnv_getNextUChar_UTF8()
729 return ch; /* return the code point */ in ucnv_getNextUChar_UTF8()