Lines Matching refs:ch
46 UChar32 ch;
75 while((ch=*src) != 0 &&
76 ((uint32_t)ch < 0xd800 || (0xe000 <= ch && ch <= 0xffff))) {
79 *pDest++ = (UChar)ch;
85 if(ch != 0) {
95 ch = *src++;
98 if((uint32_t)ch < 0xd800 || (0xe000 <= ch && ch <= 0xffff)) {
100 *pDest++ = (UChar)ch;
105 } else if(0x10000 <= ch && ch <= 0x10ffff) {
107 *pDest++ = U16_LEAD(ch);
108 *pDest++ = U16_TRAIL(ch);
113 } else if((ch = subchar) < 0) {
160 UChar32 ch;
190 while((ch=*src) != 0 && !U16_IS_SURROGATE(ch)) {
193 *pDest++ = ch;
199 if(ch != 0) {
209 ch = *src++;
210 if(!U16_IS_SURROGATE(ch)) {
211 /* write or count ch below */
212 } else if(U16_IS_SURROGATE_LEAD(ch) && src < srcLimit && U16_IS_TRAIL(ch2 = *src)) {
214 ch = U16_GET_SUPPLEMENTARY(ch, ch2);
215 } else if((ch = subchar) < 0) {
223 *pDest++ = ch;
409 UChar32 ch;
452 while(((ch = *pSrc) != 0) && (pDest < pDestLimit)) {
453 if(ch <= 0x7f){
454 *pDest++=(UChar)ch;
457 if(ch > 0xe0) {
459 ch <= 0xec &&
463 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
464 *pDest++ = (UChar)((ch << 12) | (t1 << 6) | t2);
468 } else if(ch < 0xe0) {
470 ch >= 0xc2 &&
473 *pDest++ = (UChar)(((ch & 0x1f) << 6) | t1);
481 ch=utf8_nextCharSafeBodyTerminated(&pSrc, ch);
482 if(ch<0 && (++numSubstitutions, ch = subchar) < 0) {
485 } else if(ch<=0xFFFF) {
486 *(pDest++)=(UChar)ch;
488 *(pDest++)=U16_LEAD(ch);
490 *(pDest++)=U16_TRAIL(ch);
500 while((ch = *pSrc) != 0) {
501 if(ch <= 0x7f){
505 if(ch > 0xe0) {
507 ch <= 0xec &&
515 } else if(ch < 0xe0) {
517 ch >= 0xc2 &&
528 ch=utf8_nextCharSafeBodyTerminated(&pSrc, ch);
529 if(ch<0 && (++numSubstitutions, ch = subchar) < 0) {
533 reqLength += U16_LENGTH(ch);
562 ch = *pSrc;
563 if(ch <= 0x7f){
564 *pDest++=(UChar)ch;
567 if(ch > 0xe0) {
569 ch <= 0xec &&
573 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
574 *pDest++ = (UChar)((ch << 12) | (t1 << 6) | t2);
578 } else if(ch < 0xe0) {
580 ch >= 0xc2 &&
583 *pDest++ = (UChar)(((ch & 0x1f) << 6) | t1);
589 if(ch >= 0xf0 || subchar > 0xffff) {
602 ch=utf8_nextCharSafeBodyPointer(&pSrc, pSrcLimit, ch);
603 if(ch<0 && (++numSubstitutions, ch = subchar) < 0){
606 }else if(ch<=0xFFFF){
607 *(pDest++)=(UChar)ch;
609 *(pDest++)=U16_LEAD(ch);
610 *(pDest++)=U16_TRAIL(ch);
617 ch = *pSrc;
618 if(ch <= 0x7f){
619 *pDest++=(UChar)ch;
622 if(ch > 0xe0) {
624 ch <= 0xec &&
629 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
630 *pDest++ = (UChar)((ch << 12) | (t1 << 6) | t2);
634 } else if(ch < 0xe0) {
636 ch >= 0xc2 &&
640 *pDest++ = (UChar)(((ch & 0x1f) << 6) | t1);
648 ch=utf8_nextCharSafeBodyPointer(&pSrc, pSrcLimit, ch);
649 if(ch<0 && (++numSubstitutions, ch = subchar) < 0){
652 }else if(ch<=0xFFFF){
653 *(pDest++)=(UChar)ch;
655 *(pDest++)=U16_LEAD(ch);
657 *(pDest++)=U16_TRAIL(ch);
667 ch = *pSrc;
668 if(ch <= 0x7f){
672 if(ch > 0xe0) {
674 ch <= 0xec &&
683 } else if(ch < 0xe0) {
685 ch >= 0xc2 &&
697 ch=utf8_nextCharSafeBodyPointer(&pSrc, pSrcLimit, ch);
698 if(ch<0 && (++numSubstitutions, ch = subchar) < 0){
702 reqLength+=U16_LENGTH(ch);
745 UChar32 ch;
766 while(((ch = *pSrc) != 0) && (pDest < pDestLimit)) {
767 if(ch < 0xc0) {
773 *pDest++=(UChar)ch;
776 } else if(ch < 0xe0) { /* U+0080..U+07FF */
779 *pDest++ = (UChar)((ch << 6) + t1 - 0x3080);
783 } else if(ch < 0xf0) { /* U+0800..U+FFFF */
785 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
787 *pDest++ = (UChar)((ch << 12) + (t1 << 6) + t2 - 0x2080);
795 ch = (ch << 18) + (t1 << 12) + (t2 << 6) + t3 - 0x3c82080;
796 *(pDest++) = U16_LEAD(ch);
798 *(pDest++) = U16_TRAIL(ch);
814 while((ch = *pSrc) != 0) {
815 if(ch < 0xc0) {
824 } else if(ch < 0xe0) { /* U+0080..U+07FF */
830 } else if(ch < 0xf0) { /* U+0800..U+FFFF */
869 ch = *pSrc++;
870 if(ch < 0xc0) {
876 *pDest++=(UChar)ch;
877 } else if(ch < 0xe0) { /* U+0080..U+07FF */
879 *pDest++ = (UChar)((ch << 6) + *pSrc++ - 0x3080);
880 } else if(ch < 0xf0) { /* U+0800..U+FFFF */
881 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
883 ch = (ch << 12) + (*pSrc++ << 6);
884 *pDest++ = (UChar)(ch + *pSrc++ - 0x2080);
887 ch = (ch << 18) + (*pSrc++ << 12);
888 ch += *pSrc++ << 6;
889 ch += *pSrc++ - 0x3c82080;
890 *(pDest++) = U16_LEAD(ch);
891 *(pDest++) = U16_TRAIL(ch);
899 ch = *pSrc++;
900 if(ch < 0xc0) {
906 *pDest++=(UChar)ch;
908 } else if(ch < 0xe0) { /* U+0080..U+07FF */
911 *pDest++ = (UChar)((ch << 6) + *pSrc++ - 0x3080);
914 } else if(ch < 0xf0) { /* U+0800..U+FFFF */
916 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
918 ch = (ch << 12) + (*pSrc++ << 6);
919 *pDest++ = (UChar)(ch + *pSrc++ - 0x2080);
926 ch = (ch << 18) + (*pSrc++ << 12);
927 ch += *pSrc++ << 6;
928 ch += *pSrc++ - 0x3c82080;
929 *(pDest++) = U16_LEAD(ch);
930 *(pDest++) = U16_TRAIL(ch);
985 uint32_t ch=0,ch2=0;
1009 while((ch=*pSrc)!=0) {
1011 if(ch <= 0x7f) {
1013 *pDest++ = (uint8_t)ch;
1018 } else if(ch <= 0x7ff) {
1020 *pDest++=(uint8_t)((ch>>6)|0xc0);
1021 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1026 } else if(ch <= 0xd7ff || ch >= 0xe000) {
1028 *pDest++=(uint8_t)((ch>>12)|0xe0);
1029 *pDest++=(uint8_t)(((ch>>6)&0x3f)|0x80);
1030 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1035 } else /* ch is a surrogate */ {
1039 if(U16_IS_SURROGATE_LEAD(ch) && U16_IS_TRAIL(ch2=*pSrc)) {
1041 ch=U16_GET_SUPPLEMENTARY(ch, ch2);
1043 ch=subchar;
1051 length = U8_LENGTH(ch);
1054 pDest=_appendUTF8(pDest, ch);
1061 while((ch=*pSrc++)!=0) {
1062 if(ch<=0x7f) {
1064 } else if(ch<=0x7ff) {
1066 } else if(!U16_IS_SURROGATE(ch)) {
1068 } else if(U16_IS_SURROGATE_LEAD(ch) && U16_IS_TRAIL(ch2=*pSrc)) {
1105 ch=*pSrc++;
1106 if(ch <= 0x7f) {
1107 *pDest++ = (uint8_t)ch;
1108 } else if(ch <= 0x7ff) {
1109 *pDest++=(uint8_t)((ch>>6)|0xc0);
1110 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1111 } else if(ch <= 0xd7ff || ch >= 0xe000) {
1112 *pDest++=(uint8_t)((ch>>12)|0xe0);
1113 *pDest++=(uint8_t)(((ch>>6)&0x3f)|0x80);
1114 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1115 } else /* ch is a surrogate */ {
1122 --pSrc; /* undo ch=*pSrc++ for the lead surrogate */
1126 if(U16_IS_SURROGATE_LEAD(ch) && U16_IS_TRAIL(ch2=*pSrc)) {
1128 ch=U16_GET_SUPPLEMENTARY(ch, ch2);
1131 *pDest++=(uint8_t)((ch>>18)|0xf0);
1132 *pDest++=(uint8_t)(((ch>>12)&0x3f)|0x80);
1133 *pDest++=(uint8_t)(((ch>>6)&0x3f)|0x80);
1134 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1138 ch=subchar;
1146 pDest=_appendUTF8(pDest, ch);
1153 ch=*pSrc++;
1154 if(ch <= 0x7f) {
1156 *pDest++ = (uint8_t)ch;
1161 } else if(ch <= 0x7ff) {
1163 *pDest++=(uint8_t)((ch>>6)|0xc0);
1164 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1169 } else if(ch <= 0xd7ff || ch >= 0xe000) {
1171 *pDest++=(uint8_t)((ch>>12)|0xe0);
1172 *pDest++=(uint8_t)(((ch>>6)&0x3f)|0x80);
1173 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1178 } else /* ch is a surrogate */ {
1181 if(U16_IS_SURROGATE_LEAD(ch) && pSrc<pSrcLimit && U16_IS_TRAIL(ch2=*pSrc)) {
1183 ch=U16_GET_SUPPLEMENTARY(ch, ch2);
1185 ch=subchar;
1193 length = U8_LENGTH(ch);
1196 pDest=_appendUTF8(pDest, ch);
1204 ch=*pSrc++;
1205 if(ch<=0x7f) {
1207 } else if(ch<=0x7ff) {
1209 } else if(!U16_IS_SURROGATE(ch)) {
1211 } else if(U16_IS_SURROGATE_LEAD(ch) && pSrc<pSrcLimit && U16_IS_TRAIL(ch2=*pSrc)) {
1265 UChar32 ch;
1295 while(((ch = *pSrc) != 0) && ch <= 0x7f && (pDest < pDestLimit)) {
1296 *pDest++=(UChar)ch;
1299 if(ch == 0) {
1321 while(pSrc < pSrcLimit && (ch = *pSrc) <= 0x7f) {
1322 *pDest++=(UChar)ch;
1345 ch = *pSrc;
1346 if(ch <= 0x7f){
1347 *pDest++=(UChar)ch;
1350 if(ch >= 0xe0) {
1352 ch <= 0xef &&
1356 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
1357 *pDest++ = (UChar)((ch << 12) | (t1 << 6) | t2);
1363 ch >= 0xc0 &&
1366 *pDest++ = (UChar)(((ch & 0x1f) << 6) | t1);
1384 utf8_nextCharSafeBodyPointer(&pSrc, pSrcLimit, ch);
1398 ch = *pSrc;
1399 if(ch <= 0x7f){
1400 *pDest++=(UChar)ch;
1403 if(ch >= 0xe0) {
1405 ch <= 0xef &&
1410 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
1411 *pDest++ = (UChar)((ch << 12) | (t1 << 6) | t2);
1417 ch >= 0xc0 &&
1421 *pDest++ = (UChar)(((ch & 0x1f) << 6) | t1);
1433 utf8_nextCharSafeBodyPointer(&pSrc, pSrcLimit, ch);
1452 ch = *pSrc;
1453 if(ch <= 0x7f) {
1457 if(ch >= 0xe0) {
1459 ch <= 0xef &&
1470 ch >= 0xc0 &&
1486 utf8_nextCharSafeBodyPointer(&pSrc, pSrcLimit, ch);
1488 reqLength+=U16_LENGTH(ch);
1516 uint32_t ch=0;
1535 while((ch=*src)<=0x7f && ch != 0 && pDest<pDestLimit) {
1536 *pDest++ = (uint8_t)ch;
1539 if(ch == 0) {
1561 while(src < pSrcLimit && (ch = *src) <= 0x7f && ch != 0) {
1562 *pDest++=(uint8_t)ch;
1585 ch=*src++;
1586 if(ch <= 0x7f && ch != 0) {
1587 *pDest++ = (uint8_t)ch;
1588 } else if(ch <= 0x7ff) {
1589 *pDest++=(uint8_t)((ch>>6)|0xc0);
1590 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1592 *pDest++=(uint8_t)((ch>>12)|0xe0);
1593 *pDest++=(uint8_t)(((ch>>6)&0x3f)|0x80);
1594 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1600 ch=*src++;
1601 if(ch <= 0x7f && ch != 0) {
1603 *pDest++ = (uint8_t)ch;
1608 } else if(ch <= 0x7ff) {
1610 *pDest++=(uint8_t)((ch>>6)|0xc0);
1611 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1618 *pDest++=(uint8_t)((ch>>12)|0xe0);
1619 *pDest++=(uint8_t)(((ch>>6)&0x3f)|0x80);
1620 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1628 ch=*src++;
1629 if(ch <= 0x7f && ch != 0) {
1631 } else if(ch<=0x7ff) {