Home | History | Annotate | Download | only in common

Lines Matching refs:ch

42     UChar32 ch;
70 while((ch=*src) != 0 &&
71 ((uint32_t)ch < 0xd800 || (0xe000 <= ch && ch <= 0xffff))) {
74 *pDest++ = (UChar)ch;
80 if(ch != 0) {
90 ch = *src++;
93 if((uint32_t)ch < 0xd800 || (0xe000 <= ch && ch <= 0xffff)) {
95 *pDest++ = (UChar)ch;
100 } else if(0x10000 <= ch && ch <= 0x10ffff) {
102 *pDest++ = U16_LEAD(ch);
103 *pDest++ = U16_TRAIL(ch);
108 } else if((ch = subchar) < 0) {
155 UChar32 ch;
184 while((ch=*src) != 0 && !U16_IS_SURROGATE(ch)) {
187 *pDest++ = ch;
193 if(ch != 0) {
203 ch = *src++;
204 if(!U16_IS_SURROGATE(ch)) {
205 /* write or count ch below */
206 } else if(U16_IS_SURROGATE_LEAD(ch) && src < srcLimit && U16_IS_TRAIL(ch2 = *src)) {
208 ch = U16_GET_SUPPLEMENTARY(ch, ch2);
209 } else if((ch = subchar) < 0) {
217 *pDest++ = ch;
402 UChar32 ch;
444 while(((ch = *pSrc) != 0) && (pDest < pDestLimit)) {
445 if(ch <= 0x7f){
446 *pDest++=(UChar)ch;
449 if(ch > 0xe0) {
451 ch <= 0xec &&
455 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
456 *pDest++ = (UChar)((ch << 12) | (t1 << 6) | t2);
460 } else if(ch < 0xe0) {
462 ch >= 0xc2 &&
465 *pDest++ = (UChar)(((ch & 0x1f) << 6) | t1);
473 ch=utf8_nextCharSafeBodyTerminated(&pSrc, ch);
474 if(ch<0 && (++numSubstitutions, ch = subchar) < 0) {
477 } else if(ch<=0xFFFF) {
478 *(pDest++)=(UChar)ch;
480 *(pDest++)=UTF16_LEAD(ch);
482 *(pDest++)=UTF16_TRAIL(ch);
492 while((ch = *pSrc) != 0) {
493 if(ch <= 0x7f){
497 if(ch > 0xe0) {
499 ch <= 0xec &&
507 } else if(ch < 0xe0) {
509 ch >= 0xc2 &&
520 ch=utf8_nextCharSafeBodyTerminated(&pSrc, ch);
521 if(ch<0 && (++numSubstitutions, ch = subchar) < 0) {
525 reqLength += U16_LENGTH(ch);
554 ch = *pSrc;
555 if(ch <= 0x7f){
556 *pDest++=(UChar)ch;
559 if(ch > 0xe0) {
561 ch <= 0xec &&
565 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
566 *pDest++ = (UChar)((ch << 12) | (t1 << 6) | t2);
570 } else if(ch < 0xe0) {
572 ch >= 0xc2 &&
575 *pDest++ = (UChar)(((ch & 0x1f) << 6) | t1);
581 if(ch >= 0xf0 || subchar > 0xffff) {
594 ch=utf8_nextCharSafeBodyPointer(&pSrc, pSrcLimit, ch);
595 if(ch<0 && (++numSubstitutions, ch = subchar) < 0){
598 }else if(ch<=0xFFFF){
599 *(pDest++)=(UChar)ch;
601 *(pDest++)=UTF16_LEAD(ch);
603 *(pDest++)=UTF16_TRAIL(ch);
614 ch = *pSrc;
615 if(ch <= 0x7f){
616 *pDest++=(UChar)ch;
619 if(ch > 0xe0) {
621 ch <= 0xec &&
626 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
627 *pDest++ = (UChar)((ch << 12) | (t1 << 6) | t2);
631 } else if(ch < 0xe0) {
633 ch >= 0xc2 &&
637 *pDest++ = (UChar)(((ch & 0x1f) << 6) | t1);
645 ch=utf8_nextCharSafeBodyPointer(&pSrc, pSrcLimit, ch);
646 if(ch<0 && (++numSubstitutions, ch = subchar) < 0){
649 }else if(ch<=0xFFFF){
650 *(pDest++)=(UChar)ch;
652 *(pDest++)=UTF16_LEAD(ch);
654 *(pDest++)=UTF16_TRAIL(ch);
664 ch = *pSrc;
665 if(ch <= 0x7f){
669 if(ch > 0xe0) {
671 ch <= 0xec &&
680 } else if(ch < 0xe0) {
682 ch >= 0xc2 &&
694 ch=utf8_nextCharSafeBodyPointer(&pSrc, pSrcLimit, ch);
695 if(ch<0 && (++numSubstitutions, ch = subchar) < 0){
699 reqLength+=UTF_CHAR_LENGTH(ch);
743 UChar32 ch;
762 while(((ch = *pSrc) != 0) && (pDest < pDestLimit)) {
763 if(ch < 0xc0) {
769 *pDest++=(UChar)ch;
772 } else if(ch < 0xe0) { /* U+0080..U+07FF */
775 *pDest++ = (UChar)((ch << 6) + t1 - 0x3080);
779 } else if(ch < 0xf0) { /* U+0800..U+FFFF */
781 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
783 *pDest++ = (UChar)((ch << 12) + (t1 << 6) + t2 - 0x2080);
791 ch = (ch << 18) + (t1 << 12) + (t2 << 6) + t3 - 0x3c82080;
792 *(pDest++) = U16_LEAD(ch);
794 *(pDest++) = U16_TRAIL(ch);
810 while((ch = *pSrc) != 0) {
811 if(ch < 0xc0) {
820 } else if(ch < 0xe0) { /* U+0080..U+07FF */
826 } else if(ch < 0xf0) { /* U+0800..U+FFFF */
865 ch = *pSrc++;
866 if(ch < 0xc0) {
872 *pDest++=(UChar)ch;
873 } else if(ch < 0xe0) { /* U+0080..U+07FF */
875 *pDest++ = (UChar)((ch << 6) + *pSrc++ - 0x3080);
876 } else if(ch < 0xf0) { /* U+0800..U+FFFF */
877 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
879 ch = (ch << 12) + (*pSrc++ << 6);
880 *pDest++ = (UChar)(ch + *pSrc++ - 0x2080);
883 ch = (ch << 18) + (*pSrc++ << 12);
884 ch += *pSrc++ << 6;
885 ch += *pSrc++ - 0x3c82080;
886 *(pDest++) = U16_LEAD(ch);
887 *(pDest++) = U16_TRAIL(ch);
895 ch = *pSrc++;
896 if(ch < 0xc0) {
902 *pDest++=(UChar)ch;
904 } else if(ch < 0xe0) { /* U+0080..U+07FF */
907 *pDest++ = (UChar)((ch << 6) + *pSrc++ - 0x3080);
910 } else if(ch < 0xf0) { /* U+0800..U+FFFF */
912 /* no need for (ch & 0xf) because the upper bits are truncated after <<12 in the cast to (UChar) */
914 ch = (ch << 12) + (*pSrc++ << 6);
915 *pDest++ = (UChar)(ch + *pSrc++ - 0x2080);
922 ch = (ch << 18) + (*pSrc++ << 12);
923 ch += *pSrc++ << 6;
924 ch += *pSrc++ - 0x3c82080;
925 *(pDest++) = U16_LEAD(ch);
926 *(pDest++) = U16_TRAIL(ch);
982 uint32_t ch=0,ch2=0;
1005 while((ch=*pSrc)!=0) {
1007 if(ch <= 0x7f) {
1009 *pDest++ = (char)ch;
1014 } else if(ch <= 0x7ff) {
1016 *pDest++=(uint8_t)((ch>>6)|0xc0);
1017 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1022 } else if(ch <= 0xd7ff || ch >= 0xe000) {
1024 *pDest++=(uint8_t)((ch>>12)|0xe0);
1025 *pDest++=(uint8_t)(((ch>>6)&0x3f)|0x80);
1026 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1031 } else /* ch is a surrogate */ {
1035 if(UTF_IS_SURROGATE_FIRST(ch) && UTF_IS_TRAIL(ch2=*pSrc)) {
1037 ch=UTF16_GET_PAIR_VALUE(ch, ch2);
1039 ch=subchar;
1047 length = U8_LENGTH(ch);
1050 pDest=_appendUTF8(pDest, ch);
1057 while((ch=*pSrc++)!=0) {
1058 if(ch<=0x7f) {
1060 } else if(ch<=0x7ff) {
1062 } else if(!UTF_IS_SURROGATE(ch)) {
1064 } else if(UTF_IS_SURROGATE_FIRST(ch) && UTF_IS_TRAIL(ch2=*pSrc)) {
1101 ch=*pSrc++;
1102 if(ch <= 0x7f) {
1103 *pDest++ = (char)ch;
1104 } else if(ch <= 0x7ff) {
1105 *pDest++=(uint8_t)((ch>>6)|0xc0);
1106 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1107 } else if(ch <= 0xd7ff || ch >= 0xe000) {
1108 *pDest++=(uint8_t)((ch>>12)|0xe0);
1109 *pDest++=(uint8_t)(((ch>>6)&0x3f)|0x80);
1110 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1111 } else /* ch is a surrogate */ {
1118 --pSrc; /* undo ch=*pSrc++ for the lead surrogate */
1122 if(UTF_IS_SURROGATE_FIRST(ch) && UTF_IS_TRAIL(ch2=*pSrc)) {
1124 ch=UTF16_GET_PAIR_VALUE(ch, ch2);
1127 *pDest++=(uint8_t)((ch>>18)|0xf0);
1128 *pDest++=(uint8_t)(((ch>>12)&0x3f)|0x80);
1129 *pDest++=(uint8_t)(((ch>>6)&0x3f)|0x80);
1130 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1134 ch=subchar;
1142 pDest=_appendUTF8(pDest, ch);
1149 ch=*pSrc++;
1150 if(ch <= 0x7f) {
1152 *pDest++ = (char)ch;
1157 } else if(ch <= 0x7ff) {
1159 *pDest++=(uint8_t)((ch>>6)|0xc0);
1160 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1165 } else if(ch <= 0xd7ff || ch >= 0xe000) {
1167 *pDest++=(uint8_t)((ch>>12)|0xe0);
1168 *pDest++=(uint8_t)(((ch>>6)&0x3f)|0x80);
1169 *pDest++=(uint8_t)((ch&0x3f)|0x80);
1174 } else /* ch is a surrogate */ {
1177 if(UTF_IS_SURROGATE_FIRST(ch) && pSrc<pSrcLimit && UTF_IS_TRAIL(ch2=*pSrc)) {
1179 ch=UTF16_GET_PAIR_VALUE(ch, ch2);
1181 ch=subchar;
1189 length = U8_LENGTH(ch);
1192 pDest=_appendUTF8(pDest, ch);
1200 ch=*pSrc++;
1201 if(ch<=0x7f) {
1203 } else if(ch<=0x7ff) {
1205 } else if(!UTF_IS_SURROGATE(ch)) {
1207 } else if(UTF_IS_SURROGATE_FIRST(ch) && pSrc<pSrcLimit && UTF_IS_TRAIL(ch2=*pSrc)) {