Home | History | Annotate | Download | only in common

Lines Matching refs:ch

48     UChar32 ch;
77 while((ch=*src) != 0 &&
78 ((uint32_t)ch < 0xd800 || (0xe000 <= ch && ch <= 0xffff))) {
81 *pDest++ = (UChar)ch;
87 if(ch != 0) {
97 ch = *src++;
100 if((uint32_t)ch < 0xd800 || (0xe000 <= ch && ch <= 0xffff)) {
102 *pDest++ = (UChar)ch;
107 } else if(0x10000 <= ch && ch <= 0x10ffff) {
109 *pDest++ = U16_LEAD(ch);
110 *pDest++ = U16_TRAIL(ch);
115 } else if((ch = subchar) < 0) {
162 UChar32 ch;
192 while((ch=*src) != 0 && !U16_IS_SURROGATE(ch)) {
195 *pDest++ = ch;
201 if(ch != 0) {
211 ch = *src++;
212 if(!U16_IS_SURROGATE(ch)) {
213 /* write or count ch below */
214 } else if(U16_IS_SURROGATE_LEAD(ch) && src < srcLimit && U16_IS_TRAIL(ch2 = *src)) {
216 ch = U16_GET_SUPPLEMENTARY(ch, ch2);
217 } else if((ch = subchar) < 0) {
225 *pDest++ = ch;
561 UChar32 ch;
582 while(((ch = *pSrc) != 0) && (pDest < pDestLimit)) {
583 if(ch < 0xc0) {
589 *pDest++=(UChar)ch;
592 } else if(ch < 0xe0) { /* U+0080..U+07FF */
595 *pDest++ = (UChar)((ch << 6) + t1 - 0x3080);
599 } else if(ch < 0xf0) { /* U+0800..U+FFFF */
601 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
603 *pDest++ = (UChar)((ch << 12) + (t1 << 6) + t2 - 0x2080);
611 ch = (ch << 18) + (t1 << 12) + (t2 << 6) + t3 - 0x3c82080;
612 *(pDest++) = U16_LEAD(ch);
614 *(pDest++) = U16_TRAIL(ch);
630 while((ch = *pSrc) != 0) {
631 if(ch < 0xc0) {
640 } else if(ch < 0xe0) { /* U+0080..U+07FF */
646 } else if(ch < 0xf0) { /* U+0800..U+FFFF */
685 ch = *pSrc++;
686 if(ch < 0xc0) {
692 *pDest++=(UChar)ch;
693 } else if(ch < 0xe0) { /* U+0080..U+07FF */
695 *pDest++ = (UChar)((ch << 6) + *pSrc++ - 0x3080);
696 } else if(ch < 0xf0) { /* U+0800..U+FFFF */
697 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
699 ch = (ch << 12) + (*pSrc++ << 6);
700 *pDest++ = (UChar)(ch + *pSrc++ - 0x2080);
703 ch = (ch << 18) + (*pSrc++ << 12);
704 ch += *pSrc++ << 6;
705 ch += *pSrc++ - 0x3c82080;
706 *(pDest++) = U16_LEAD(ch);
707 *(pDest++) = U16_TRAIL(ch);
715 ch = *pSrc++;
716 if(ch < 0xc0) {
722 *pDest++=(UChar)ch;
724 } else if(ch < 0xe0) { /* U+0080..U+07FF */
727 *pDest++ = (UChar)((ch << 6) + *pSrc++ - 0x3080);
730 } else if(ch < 0xf0) { /* U+0800..U+FFFF */
732 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
734 ch = (ch << 12) + (*pSrc++ << 6);
735 *pDest++ = (UChar)(ch + *pSrc++ - 0x2080);
742 ch = (ch << 18) + (*pSrc++ << 12);
743 ch += *pSrc++ << 6;
744 ch += *pSrc++ - 0x3c82080;
745 *(pDest++) = U16_LEAD(ch);
746 *(pDest++) = U16_TRAIL(ch);
801 uint32_t ch=0,ch2=0;
825 while((ch=*pSrc)!=0) {
827 if(ch <= 0x7f) {
829 *pDest++ = (uint8_t)ch;
834 } else if(ch <= 0x7ff) {
836 *pDest++=(uint8_t)((ch>>6)|0xc0);
837 *pDest++=(uint8_t)((ch&0x3f)|0x80);
842 } else if(ch <= 0xd7ff || ch >= 0xe000) {
844 *pDest++=(uint8_t)((ch>>12)|0xe0);
845 *pDest++=(uint8_t)(((ch>>6)&0x3f)|0x80);
846 *pDest++=(uint8_t)((ch&0x3f)|0x80);
851 } else /* ch is a surrogate */ {
855 if(U16_IS_SURROGATE_LEAD(ch) && U16_IS_TRAIL(ch2=*pSrc)) {
857 ch=U16_GET_SUPPLEMENTARY(ch, ch2);
859 ch=subchar;
867 length = U8_LENGTH(ch);
870 pDest=_appendUTF8(pDest, ch);
877 while((ch=*pSrc++)!=0) {
878 if(ch<=0x7f) {
880 } else if(ch<=0x7ff) {
882 } else if(!U16_IS_SURROGATE(ch)) {
884 } else if(U16_IS_SURROGATE_LEAD(ch) && U16_IS_TRAIL(ch2=*pSrc)) {
921 ch=*pSrc++;
922 if(ch <= 0x7f) {
923 *pDest++ = (uint8_t)ch;
924 } else if(ch <= 0x7ff) {
925 *pDest++=(uint8_t)((ch>>6)|0xc0);
926 *pDest++=(uint8_t)((ch&0x3f)|0x80);
927 } else if(ch <= 0xd7ff || ch >= 0xe000) {
928 *pDest++=(uint8_t)((ch>>12)|0xe0);
929 ch>>6)&0x3f)|0x80);
930 *pDest++=(uint8_t)((ch&0x3f)|0x80);
931 } else /* ch is a surrogate */ {
938 --pSrc; /* undo ch=*pSrc++ for the lead surrogate */
942 if(U16_IS_SURROGATE_LEAD(ch) && U16_IS_TRAIL(ch2=*pSrc)) {
944 ch=U16_GET_SUPPLEMENTARY(ch, ch2);
947 *pDest++=(uint8_t)((ch>>18)|0xf0);
948 *pDest++=(uint8_t)(((ch>>12)&0x3f)|0x80);
949 *pDest++=(uint8_t)(((ch>>6)&0x3f)|0x80);
950 *pDest++=(uint8_t)((ch&0x3f)|0x80);
954 ch=subchar;
962 pDest=_appendUTF8(pDest, ch);
969 ch=*pSrc++;
970 if(ch <= 0x7f) {
972 *pDest++ = (uint8_t)ch;
977 } else if(ch <= 0x7ff) {
979 *pDest++=(uint8_t)((ch>>6)|0xc0);
980 *pDest++=(uint8_t)((ch&0x3f)|0x80);
985 } else if(ch <= 0xd7ff || ch >= 0xe000) {
987 *pDest++=(uint8_t)((ch>>12)|0xe0);
988 *pDest++=(uint8_t)(((ch>>6)&0x3f)|0x80);
989 *pDest++=(uint8_t)((ch&0x3f)|0x80);
994 } else /* ch is a surrogate */ {
997 if(U16_IS_SURROGATE_LEAD(ch) && pSrc<pSrcLimit && U16_IS_TRAIL(ch2=*pSrc)) {
999 ch=U16_GET_SUPPLEMENTARY(ch, ch2);
1001 ch=subchar;
1009 length = U8_LENGTH(ch);
1012 pDest=_appendUTF8(pDest, ch);
1020 ch=*pSrc++;
1021 if(ch<=0x7f) {
1023 } else if(ch<=0x7ff) {
1025 } else if(!U16_IS_SURROGATE(ch)) {
1027 } else if(U16_IS_SURROGATE_LEAD(ch) && pSrc<pSrcLimit && U16_IS_TRAIL(ch2=*pSrc)) {
1123 UChar32 ch;
1160 ch = (uint8_t)src[i++];
1161 if(U8_IS_SINGLE(ch)) {
1162 *pDest++=(UChar)ch;
1164 if(ch >= 0xe0) {
1166 ch <= 0xef &&
1170 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
1171 *pDest++ = (UChar)((ch << 12) | (t1 << 6) | t2);
1177 ch >= 0xc0 &&
1180 *pDest++ = (UChar)(((ch & 0x1f) << 6) | t1);
1194 --i; // back out byte ch
1198 utf8_nextCharSafeBody((const uint8_t *)src, &(i), srcLength, ch, -1);
1207 ch = (uint8_t)src[i++];
1208 if(U8_IS_SINGLE(ch)){
1209 *pDest++=(UChar)ch;
1211 if(ch >= 0xe0) {
1213 ch <= 0xef &&
1218 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
1219 *pDest++ = (UChar)((ch << 12) | (t1 << 6) | t2);
1225 ch >= 0xc0 &&
1229 *pDest++ = (UChar)(((ch & 0x1f) << 6) | t1);
1240 utf8_nextCharSafeBody((const uint8_t *)src, &(i), srcLength, ch, -1);
1259 ch = (uint8_t)src[i++];
1260 if(U8_IS_SINGLE(ch)) {
1263 if(ch >= 0xe0) {
1265 ch <= 0xef &&
1276 ch >= 0xc0 &&
1291 utf8_nextCharSafeBody((const uint8_t *)src, &(i), srcLength, ch, -1);
1293 reqLength+=U16_LENGTH(ch);
1321 uint32_t ch=0;
1340 while((ch=*src)<=0x7f && ch != 0 && pDest<pDestLimit) {
1341 *pDest++ = (uint8_t)ch;
1344 if(ch == 0) {
1366 while(src < pSrcLimit && (ch = *src) <= 0x7f && ch != 0) {
1367 *pDest++=(uint8_t)ch;
1390 ch=*src++;
1391 if(ch <= 0x7f && ch != 0) {
1392 *pDest++ = (uint8_t)ch;
1393 } else if(ch <= 0x7ff) {
1394 *pDest++=(uint8_t)((ch>>6)|0xc0);
1395 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1397 *pDest++=(uint8_t)((ch>>12)|0xe0);
1398 *pDest++=(uint8_t)(((ch>>6)&0x3f)|0x80);
1399 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1405 ch=*src++;
1406 if(ch <= 0x7f && ch != 0) {
1408 *pDest++ = (uint8_t)ch;
1413 } else if(ch <= 0x7ff) {
1415 *pDest++=(uint8_t)((ch>>6)|0xc0);
1416 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1423 *pDest++=(uint8_t)((ch>>12)|0xe0);
1424 ch>>6)&0x3f)|0x80);
1425 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1433 ch=*src++;
1434 if(ch <= 0x7f && ch != 0) {
1436 } else if(ch<=0x7ff) {