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;
411 UChar32 ch;
454 while(((ch = *pSrc) != 0) && (pDest < pDestLimit)) {
455 if(ch <= 0x7f){
456 *pDest++=(UChar)ch;
459 if(ch > 0xe0) {
461 ch <= 0xec &&
465 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
466 *pDest++ = (UChar)((ch << 12) | (t1 << 6) | t2);
470 } else if(ch < 0xe0) {
472 ch >= 0xc2 &&
475 *pDest++ = (UChar)(((ch & 0x1f) << 6) | t1);
483 ch=utf8_nextCharSafeBodyTerminated(&pSrc, ch);
484 if(ch<0 && (++numSubstitutions, ch = subchar) < 0) {
487 } else if(ch<=0xFFFF) {
488 *(pDest++)=(UChar)ch;
490 *(pDest++)=U16_LEAD(ch);
492 *(pDest++)=U16_TRAIL(ch);
502 while((ch = *pSrc) != 0) {
503 if(ch <= 0x7f){
507 if(ch > 0xe0) {
509 ch <= 0xec &&
517 } else if(ch < 0xe0) {
519 ch >= 0xc2 &&
530 ch=utf8_nextCharSafeBodyTerminated(&pSrc, ch);
531 if(ch<0 && (++numSubstitutions, ch = subchar) < 0) {
535 reqLength += U16_LENGTH(ch);
564 ch = *pSrc;
565 if(ch <= 0x7f){
566 *pDest++=(UChar)ch;
569 if(ch > 0xe0) {
571 ch <= 0xec &&
575 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
576 *pDest++ = (UChar)((ch << 12) | (t1 << 6) | t2);
580 } else if(ch < 0xe0) {
582 ch >= 0xc2 &&
585 *pDest++ = (UChar)(((ch & 0x1f) << 6) | t1);
591 if(ch >= 0xf0 || subchar > 0xffff) {
604 ch=utf8_nextCharSafeBodyPointer(&pSrc, pSrcLimit, ch);
605 if(ch<0 && (++numSubstitutions, ch = subchar) < 0){
608 }else if(ch<=0xFFFF){
609 *(pDest++)=(UChar)ch;
611 *(pDest++)=U16_LEAD(ch);
612 *(pDest++)=U16_TRAIL(ch);
619 ch = *pSrc;
620 if(ch <= 0x7f){
621 *pDest++=(UChar)ch;
624 if(ch > 0xe0) {
626 ch <= 0xec &&
631 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
632 *pDest++ = (UChar)((ch << 12) | (t1 << 6) | t2);
636 } else if(ch < 0xe0) {
638 ch >= 0xc2 &&
642 *pDest++ = (UChar)(((ch & 0x1f) << 6) | t1);
650 ch=utf8_nextCharSafeBodyPointer(&pSrc, pSrcLimit, ch);
651 if(ch<0 && (++numSubstitutions, ch = subchar) < 0){
654 }else if(ch<=0xFFFF){
655 *(pDest++)=(UChar)ch;
657 *(pDest++)=U16_LEAD(ch);
659 *(pDest++)=U16_TRAIL(ch);
669 ch = *pSrc;
670 if(ch <= 0x7f){
674 if(ch > 0xe0) {
676 ch <= 0xec &&
685 } else if(ch < 0xe0) {
687 ch >= 0xc2 &&
699 ch=utf8_nextCharSafeBodyPointer(&pSrc, pSrcLimit, ch);
700 if(ch<0 && (++numSubstitutions, ch = subchar) < 0){
704 reqLength+=U16_LENGTH(ch);
747 UChar32 ch;
768 while(((ch = *pSrc) != 0) && (pDest < pDestLimit)) {
769 if(ch < 0xc0) {
775 *pDest++=(UChar)ch;
778 } else if(ch < 0xe0) { /* U+0080..U+07FF */
781 *pDest++ = (UChar)((ch << 6) + t1 - 0x3080);
785 } else if(ch < 0xf0) { /* U+0800..U+FFFF */
787 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
789 *pDest++ = (UChar)((ch << 12) + (t1 << 6) + t2 - 0x2080);
797 ch = (ch << 18) + (t1 << 12) + (t2 << 6) + t3 - 0x3c82080;
798 *(pDest++) = U16_LEAD(ch);
800 *(pDest++) = U16_TRAIL(ch);
816 while((ch = *pSrc) != 0) {
817 if(ch < 0xc0) {
826 } else if(ch < 0xe0) { /* U+0080..U+07FF */
832 } else if(ch < 0xf0) { /* U+0800..U+FFFF */
871 ch = *pSrc++;
872 if(ch < 0xc0) {
878 *pDest++=(UChar)ch;
879 } else if(ch < 0xe0) { /* U+0080..U+07FF */
881 *pDest++ = (UChar)((ch << 6) + *pSrc++ - 0x3080);
882 } else if(ch < 0xf0) { /* U+0800..U+FFFF */
883 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
885 ch = (ch << 12) + (*pSrc++ << 6);
886 *pDest++ = (UChar)(ch + *pSrc++ - 0x2080);
889 ch = (ch << 18) + (*pSrc++ << 12);
890 ch += *pSrc++ << 6;
891 ch += *pSrc++ - 0x3c82080;
892 *(pDest++) = U16_LEAD(ch);
893 *(pDest++) = U16_TRAIL(ch);
901 ch = *pSrc++;
902 if(ch < 0xc0) {
908 *pDest++=(UChar)ch;
910 } else if(ch < 0xe0) { /* U+0080..U+07FF */
913 *pDest++ = (UChar)((ch << 6) + *pSrc++ - 0x3080);
916 } else if(ch < 0xf0) { /* U+0800..U+FFFF */
918 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
920 ch = (ch << 12) + (*pSrc++ << 6);
921 *pDest++ = (UChar)(ch + *pSrc++ - 0x2080);
928 ch = (ch << 18) + (*pSrc++ << 12);
929 ch += *pSrc++ << 6;
930 ch += *pSrc++ - 0x3c82080;
931 *(pDest++) = U16_LEAD(ch);
932 *(pDest++) = U16_TRAIL(ch);
987 uint32_t ch=0,ch2=0;
1011 while((ch=*pSrc)!=0) {
1013 if(ch <= 0x7f) {
1015 *pDest++ = (uint8_t)ch;
1020 } else if(ch <= 0x7ff) {
1022 *pDest++=(uint8_t)((ch>>6)|0xc0);
1023 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1028 } else if(ch <= 0xd7ff || ch >= 0xe000) {
1030 *pDest++=(uint8_t)((ch>>12)|0xe0);
1031 *pDest++=(uint8_t)(((ch>>6)&0x3f)|0x80);
1032 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1037 } else /* ch is a surrogate */ {
1041 if(U16_IS_SURROGATE_LEAD(ch) && U16_IS_TRAIL(ch2=*pSrc)) {
1043 ch=U16_GET_SUPPLEMENTARY(ch, ch2);
1045 ch=subchar;
1053 length = U8_LENGTH(ch);
1056 pDest=_appendUTF8(pDest, ch);
1063 while((ch=*pSrc++)!=0) {
1064 if(ch<=0x7f) {
1066 } else if(ch<=0x7ff) {
1068 } else if(!U16_IS_SURROGATE(ch)) {
1070 } else if(U16_IS_SURROGATE_LEAD(ch) && U16_IS_TRAIL(ch2=*pSrc)) {
1107 ch=*pSrc++;
1108 if(ch <= 0x7f) {
1109 *pDest++ = (uint8_t)ch;
1110 } else if(ch <= 0x7ff) {
1111 *pDest++=(uint8_t)((ch>>6)|0xc0);
1112 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1113 } else if(ch <= 0xd7ff || ch >= 0xe000) {
1114 *pDest++=(uint8_t)((ch>>12)|0xe0);
1115 *pDest++=(uint8_t)(((ch>>6)&0x3f)|0x80);
1116 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1117 } else /* ch is a surrogate */ {
1124 --pSrc; /* undo ch=*pSrc++ for the lead surrogate */
1128 if(U16_IS_SURROGATE_LEAD(ch) && U16_IS_TRAIL(ch2=*pSrc)) {
1130 ch=U16_GET_SUPPLEMENTARY(ch, ch2);
1133 *pDest++=(uint8_t)((ch>>18)|0xf0);
1134 *pDest++=(uint8_t)(((ch>>12)&0x3f)|0x80);
1135 *pDest++=(uint8_t)(((ch>>6)&0x3f)|0x80);
1136 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1140 ch=subchar;
1148 pDest=_appendUTF8(pDest, ch);
1155 ch=*pSrc++;
1156 if(ch <= 0x7f) {
1158 *pDest++ = (uint8_t)ch;
1163 } else if(ch <= 0x7ff) {
1165 *pDest++=(uint8_t)((ch>>6)|0xc0);
1166 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1171 } else if(ch <= 0xd7ff || ch >= 0xe000) {
1173 *pDest++=(uint8_t)((ch>>12)|0xe0);
1174 *pDest++=(uint8_t)(((ch>>6)&0x3f)|0x80);
1175 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1180 } else /* ch is a surrogate */ {
1183 if(U16_IS_SURROGATE_LEAD(ch) && pSrc<pSrcLimit && U16_IS_TRAIL(ch2=*pSrc)) {
1185 ch=U16_GET_SUPPLEMENTARY(ch, ch2);
1187 ch=subchar;
1195 length = U8_LENGTH(ch);
1198 pDest=_appendUTF8(pDest, ch);
1206 ch=*pSrc++;
1207 if(ch<=0x7f) {
1209 } else if(ch<=0x7ff) {
1211 } else if(!U16_IS_SURROGATE(ch)) {
1213 } else if(U16_IS_SURROGATE_LEAD(ch) && pSrc<pSrcLimit && U16_IS_TRAIL(ch2=*pSrc)) {
1267 UChar32 ch;
1297 while(((ch = *pSrc) != 0) && ch <= 0x7f && (pDest < pDestLimit)) {
1298 *pDest++=(UChar)ch;
1301 if(ch == 0) {
1323 while(pSrc < pSrcLimit && (ch = *pSrc) <= 0x7f) {
1324 *pDest++=(UChar)ch;
1347 ch = *pSrc;
1348 if(ch <= 0x7f){
1349 *pDest++=(UChar)ch;
1352 if(ch >= 0xe0) {
1354 ch <= 0xef &&
1358 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
1359 *pDest++ = (UChar)((ch << 12) | (t1 << 6) | t2);
1365 ch >= 0xc0 &&
1368 *pDest++ = (UChar)(((ch & 0x1f) << 6) | t1);
1386 utf8_nextCharSafeBodyPointer(&pSrc, pSrcLimit, ch);
1400 ch = *pSrc;
1401 if(ch <= 0x7f){
1402 *pDest++=(UChar)ch;
1405 if(ch >= 0xe0) {
1407 ch <= 0xef &&
1412 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
1413 *pDest++ = (UChar)((ch << 12) | (t1 << 6) | t2);
1419 ch >= 0xc0 &&
1423 *pDest++ = (UChar)(((ch & 0x1f) << 6) | t1);
1435 utf8_nextCharSafeBodyPointer(&pSrc, pSrcLimit, ch);
1454 ch = *pSrc;
1455 if(ch <= 0x7f) {
1459 if(ch >= 0xe0) {
1461 ch <= 0xef &&
1472 ch >= 0xc0 &&
1488 utf8_nextCharSafeBodyPointer(&pSrc, pSrcLimit, ch);
1490 reqLength+=U16_LENGTH(ch);
1518 uint32_t ch=0;
1537 while((ch=*src)<=0x7f && ch != 0 && pDest<pDestLimit) {
1538 *pDest++ = (uint8_t)ch;
1541 if(ch == 0) {
1563 while(src < pSrcLimit && (ch = *src) <= 0x7f && ch != 0) {
1564 *pDest++=(uint8_t)ch;
1587 ch=*src++;
1588 if(ch <= 0x7f && ch != 0) {
1589 *pDest++ = (uint8_t)ch;
1590 } else if(ch <= 0x7ff) {
1591 *pDest++=(uint8_t)((ch>>6)|0xc0);
1592 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1594 *pDest++=(uint8_t)((ch>>12)|0xe0);
1595 *pDest++=(uint8_t)(((ch>>6)&0x3f)|0x80);
1596 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1602 ch=*src++;
1603 if(ch <= 0x7f && ch != 0) {
1605 *pDest++ = (uint8_t)ch;
1610 } else if(ch <= 0x7ff) {
1612 *pDest++=(uint8_t)((ch>>6)|0xc0);
1613 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1620 *pDest++=(uint8_t)((ch>>12)|0xe0);
1621 *pDest++=(uint8_t)(((ch>>6)&0x3f)|0x80);
1622 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1630 ch=*src++;
1631 if(ch <= 0x7f && ch != 0) {
1633 } else if(ch<=0x7ff) {