142 #ifndef __UTF_OLD_H__
143 #define __UTF_OLD_H__
160 #ifndef U_HIDE_OBSOLETE_UTF_OLD_H
161 # define U_HIDE_OBSOLETE_UTF_OLD_H 0
164 #if !defined(U_HIDE_DEPRECATED_API) && !U_HIDE_OBSOLETE_UTF_OLD_H
168 #ifdef U_USE_UTF_DEPRECATES
176 typedef int32_t UTextOffset;
208 #define UTF8_ERROR_VALUE_1 0x15
215 #define UTF8_ERROR_VALUE_2 0x9f
223 #define UTF_ERROR_VALUE 0xffff
231 #define UTF_IS_ERROR(c) \
232 (((c)&0xfffe)==0xfffe || (c)==UTF8_ERROR_VALUE_1 || (c)==UTF8_ERROR_VALUE_2)
239 #define UTF_IS_VALID(c) \
240 (UTF_IS_UNICODE_CHAR(c) && \
241 (c)!=UTF8_ERROR_VALUE_1 && (c)!=UTF8_ERROR_VALUE_2)
247 #define UTF_IS_SURROGATE(uchar) (((uchar)&0xfffff800)==0xd800)
254 #define UTF_IS_UNICODE_NONCHAR(c) \
256 ((uint32_t)(c)<=0xfdef || ((c)&0xfffe)==0xfffe) && \
257 (uint32_t)(c)<=0x10ffff)
274 #define UTF_IS_UNICODE_CHAR(c) \
275 ((uint32_t)(c)<0xd800 || \
276 ((uint32_t)(c)>0xdfff && \
277 (uint32_t)(c)<=0x10ffff && \
278 !UTF_IS_UNICODE_NONCHAR(c)))
295 #elif defined(U_STATIC_IMPLEMENTATION) || defined(U_COMMON_IMPLEMENTATION)
305 #define UTF8_COUNT_TRAIL_BYTES(leadByte) (utf8_countTrailBytes[(uint8_t)leadByte])
311 #define UTF8_MASK_LEAD_BYTE(leadByte, countTrailBytes) ((leadByte)&=(1<<(6-(countTrailBytes)))-1)
314 #define UTF8_IS_SINGLE(uchar) (((uchar)&0x80)==0)
316 #define UTF8_IS_LEAD(uchar) ((uint8_t)((uchar)-0xc0)<0x3e)
318 #define UTF8_IS_TRAIL(uchar) (((uchar)&0xc0)==0x80)
321 #define UTF8_NEED_MULTIPLE_UCHAR(c) ((uint32_t)(c)>0x7f)
337 # define UTF8_CHAR_LENGTH(c) \
338 ((uint32_t)(c)<=0x7f ? 1 : \
339 ((uint32_t)(c)<=0x7ff ? 2 : \
340 ((uint32_t)((c)-0x10000)>0xfffff ? 3 : 4) \
344 # define UTF8_CHAR_LENGTH(c) \
345 ((uint32_t)(c)<=0x7f ? 1 : \
346 ((uint32_t)(c)<=0x7ff ? 2 : \
347 ((uint32_t)(c)<=0xffff ? 3 : \
348 ((uint32_t)(c)<=0x10ffff ? 4 : \
349 ((uint32_t)(c)<=0x3ffffff ? 5 : \
350 ((uint32_t)(c)<=0x7fffffff ? 6 : 3) \
359 #define UTF8_MAX_CHAR_LENGTH 4
362 #define UTF8_ARRAY_SIZE(size) ((5*(size))/2)
365 #define UTF8_GET_CHAR_UNSAFE(s, i, c) UPRV_BLOCK_MACRO_BEGIN { \
366 int32_t _utf8_get_char_unsafe_index=(int32_t)(i); \
367 UTF8_SET_CHAR_START_UNSAFE(s, _utf8_get_char_unsafe_index); \
368 UTF8_NEXT_CHAR_UNSAFE(s, _utf8_get_char_unsafe_index, c); \
369 } UPRV_BLOCK_MACRO_END
372 #define UTF8_GET_CHAR_SAFE(s, start, i, length, c, strict) UPRV_BLOCK_MACRO_BEGIN { \
373 int32_t _utf8_get_char_safe_index=(int32_t)(i); \
374 UTF8_SET_CHAR_START_SAFE(s, start, _utf8_get_char_safe_index); \
375 UTF8_NEXT_CHAR_SAFE(s, _utf8_get_char_safe_index, length, c, strict); \
376 } UPRV_BLOCK_MACRO_END
379 #define UTF8_NEXT_CHAR_UNSAFE(s, i, c) UPRV_BLOCK_MACRO_BEGIN { \
381 if((uint8_t)((c)-0xc0)<0x35) { \
382 uint8_t __count=UTF8_COUNT_TRAIL_BYTES(c); \
383 UTF8_MASK_LEAD_BYTE(c, __count); \
387 (c)=((c)<<6)|((s)[(i)++]&0x3f); \
389 (c)=((c)<<6)|((s)[(i)++]&0x3f); \
391 (c)=((c)<<6)|((s)[(i)++]&0x3f); \
396 } UPRV_BLOCK_MACRO_END
399 #define UTF8_APPEND_CHAR_UNSAFE(s, i, c) UPRV_BLOCK_MACRO_BEGIN { \
400 if((uint32_t)(c)<=0x7f) { \
401 (s)[(i)++]=(uint8_t)(c); \
403 if((uint32_t)(c)<=0x7ff) { \
404 (s)[(i)++]=(uint8_t)(((c)>>6)|0xc0); \
406 if((uint32_t)(c)<=0xffff) { \
407 (s)[(i)++]=(uint8_t)(((c)>>12)|0xe0); \
409 (s)[(i)++]=(uint8_t)(((c)>>18)|0xf0); \
410 (s)[(i)++]=(uint8_t)((((c)>>12)&0x3f)|0x80); \
412 (s)[(i)++]=(uint8_t)((((c)>>6)&0x3f)|0x80); \
414 (s)[(i)++]=(uint8_t)(((c)&0x3f)|0x80); \
416 } UPRV_BLOCK_MACRO_END
419 #define UTF8_FWD_1_UNSAFE(s, i) UPRV_BLOCK_MACRO_BEGIN { \
420 (i)+=1+UTF8_COUNT_TRAIL_BYTES((s)[i]); \
421 } UPRV_BLOCK_MACRO_END
424 #define UTF8_FWD_N_UNSAFE(s, i, n) UPRV_BLOCK_MACRO_BEGIN { \
427 UTF8_FWD_1_UNSAFE(s, i); \
430 } UPRV_BLOCK_MACRO_END
433 #define UTF8_SET_CHAR_START_UNSAFE(s, i) UPRV_BLOCK_MACRO_BEGIN { \
434 while(UTF8_IS_TRAIL((s)[i])) { --(i); } \
435 } UPRV_BLOCK_MACRO_END
438 #define UTF8_NEXT_CHAR_SAFE(s, i, length, c, strict) UPRV_BLOCK_MACRO_BEGIN { \
441 if(UTF8_IS_LEAD(c)) { \
442 (c)=utf8_nextCharSafeBody(s, &(i), (int32_t)(length), c, strict); \
444 (c)=UTF8_ERROR_VALUE_1; \
447 } UPRV_BLOCK_MACRO_END
450 #define UTF8_APPEND_CHAR_SAFE(s, i, length, c) UPRV_BLOCK_MACRO_BEGIN { \
451 if((uint32_t)(c)<=0x7f) { \
452 (s)[(i)++]=(uint8_t)(c); \
454 (i)=utf8_appendCharSafeBody(s, (int32_t)(i), (int32_t)(length), c, NULL); \
456 } UPRV_BLOCK_MACRO_END
459 #define UTF8_FWD_1_SAFE(s, i, length) U8_FWD_1(s, i, length)
462 #define UTF8_FWD_N_SAFE(s, i, length, n) U8_FWD_N(s, i, length, n)
465 #define UTF8_SET_CHAR_START_SAFE(s, start, i) U8_SET_CP_START(s, start, i)
468 #define UTF8_PREV_CHAR_UNSAFE(s, i, c) UPRV_BLOCK_MACRO_BEGIN { \
470 if(UTF8_IS_TRAIL(c)) { \
471 uint8_t __b, __count=1, __shift=6; \
478 UTF8_MASK_LEAD_BYTE(__b, __count); \
479 (c)|=(UChar32)__b<<__shift; \
482 (c)|=(UChar32)(__b&0x3f)<<__shift; \
488 } UPRV_BLOCK_MACRO_END
491 #define UTF8_BACK_1_UNSAFE(s, i) UPRV_BLOCK_MACRO_BEGIN { \
492 while(UTF8_IS_TRAIL((s)[--(i)])) {} \
493 } UPRV_BLOCK_MACRO_END
496 #define UTF8_BACK_N_UNSAFE(s, i, n) UPRV_BLOCK_MACRO_BEGIN { \
499 UTF8_BACK_1_UNSAFE(s, i); \
502 } UPRV_BLOCK_MACRO_END
505 #define UTF8_SET_CHAR_LIMIT_UNSAFE(s, i) UPRV_BLOCK_MACRO_BEGIN { \
506 UTF8_BACK_1_UNSAFE(s, i); \
507 UTF8_FWD_1_UNSAFE(s, i); \
508 } UPRV_BLOCK_MACRO_END
511 #define UTF8_PREV_CHAR_SAFE(s, start, i, c, strict) UPRV_BLOCK_MACRO_BEGIN { \
515 (c)=utf8_prevCharSafeBody(s, start, &(i), c, strict); \
517 (c)=UTF8_ERROR_VALUE_1; \
520 } UPRV_BLOCK_MACRO_END
523 #define UTF8_BACK_1_SAFE(s, start, i) U8_BACK_1(s, start, i)
526 #define UTF8_BACK_N_SAFE(s, start, i, n) U8_BACK_N(s, start, i, n)
529 #define UTF8_SET_CHAR_LIMIT_SAFE(s, start, i, length) U8_SET_CP_LIMIT(s, start, i, length)
534 #define UTF_IS_FIRST_SURROGATE(uchar) (((uchar)&0xfffffc00)==0xd800)
537 #define UTF_IS_SECOND_SURROGATE(uchar) (((uchar)&0xfffffc00)==0xdc00)
540 #define UTF_IS_SURROGATE_FIRST(c) (((c)&0x400)==0)
543 #define UTF_SURROGATE_OFFSET ((0xd800<<10UL)+0xdc00-0x10000)
546 #define UTF16_GET_PAIR_VALUE(first, second) \
547 (((first)<<10UL)+(second)-UTF_SURROGATE_OFFSET)
550 #define UTF_FIRST_SURROGATE(supplementary) (UChar)(((supplementary)>>10)+0xd7c0)
553 #define UTF_SECOND_SURROGATE(supplementary) (UChar)(((supplementary)&0x3ff)|0xdc00)
556 #define UTF16_LEAD(supplementary) UTF_FIRST_SURROGATE(supplementary)
559 #define UTF16_TRAIL(supplementary) UTF_SECOND_SURROGATE(supplementary)
562 #define UTF16_IS_SINGLE(uchar) !UTF_IS_SURROGATE(uchar)
565 #define UTF16_IS_LEAD(uchar) UTF_IS_FIRST_SURROGATE(uchar)
568 #define UTF16_IS_TRAIL(uchar) UTF_IS_SECOND_SURROGATE(uchar)
571 #define UTF16_NEED_MULTIPLE_UCHAR(c) ((uint32_t)(c)>0xffff)
574 #define UTF16_CHAR_LENGTH(c) ((uint32_t)(c)<=0xffff ? 1 : 2)
577 #define UTF16_MAX_CHAR_LENGTH 2
580 #define UTF16_ARRAY_SIZE(size) (size)
593 #define UTF16_GET_CHAR_UNSAFE(s, i, c) UPRV_BLOCK_MACRO_BEGIN { \
595 if(UTF_IS_SURROGATE(c)) { \
596 if(UTF_IS_SURROGATE_FIRST(c)) { \
597 (c)=UTF16_GET_PAIR_VALUE((c), (s)[(i)+1]); \
599 (c)=UTF16_GET_PAIR_VALUE((s)[(i)-1], (c)); \
602 } UPRV_BLOCK_MACRO_END
605 #define UTF16_GET_CHAR_SAFE(s, start, i, length, c, strict) UPRV_BLOCK_MACRO_BEGIN { \
607 if(UTF_IS_SURROGATE(c)) { \
609 if(UTF_IS_SURROGATE_FIRST(c)) { \
610 if((i)+1<(length) && UTF_IS_SECOND_SURROGATE(__c2=(s)[(i)+1])) { \
611 (c)=UTF16_GET_PAIR_VALUE((c), __c2); \
615 (c)=UTF_ERROR_VALUE; \
618 if((i)-1>=(start) && UTF_IS_FIRST_SURROGATE(__c2=(s)[(i)-1])) { \
619 (c)=UTF16_GET_PAIR_VALUE(__c2, (c)); \
623 (c)=UTF_ERROR_VALUE; \
626 } else if((strict) && !UTF_IS_UNICODE_CHAR(c)) { \
627 (c)=UTF_ERROR_VALUE; \
629 } UPRV_BLOCK_MACRO_END
632 #define UTF16_NEXT_CHAR_UNSAFE(s, i, c) UPRV_BLOCK_MACRO_BEGIN { \
634 if(UTF_IS_FIRST_SURROGATE(c)) { \
635 (c)=UTF16_GET_PAIR_VALUE((c), (s)[(i)++]); \
637 } UPRV_BLOCK_MACRO_END
640 #define UTF16_APPEND_CHAR_UNSAFE(s, i, c) UPRV_BLOCK_MACRO_BEGIN { \
641 if((uint32_t)(c)<=0xffff) { \
642 (s)[(i)++]=(uint16_t)(c); \
644 (s)[(i)++]=(uint16_t)(((c)>>10)+0xd7c0); \
645 (s)[(i)++]=(uint16_t)(((c)&0x3ff)|0xdc00); \
647 } UPRV_BLOCK_MACRO_END
650 #define UTF16_FWD_1_UNSAFE(s, i) UPRV_BLOCK_MACRO_BEGIN { \
651 if(UTF_IS_FIRST_SURROGATE((s)[(i)++])) { \
654 } UPRV_BLOCK_MACRO_END
657 #define UTF16_FWD_N_UNSAFE(s, i, n) UPRV_BLOCK_MACRO_BEGIN { \
660 UTF16_FWD_1_UNSAFE(s, i); \
663 } UPRV_BLOCK_MACRO_END
666 #define UTF16_SET_CHAR_START_UNSAFE(s, i) UPRV_BLOCK_MACRO_BEGIN { \
667 if(UTF_IS_SECOND_SURROGATE((s)[i])) { \
670 } UPRV_BLOCK_MACRO_END
673 #define UTF16_NEXT_CHAR_SAFE(s, i, length, c, strict) UPRV_BLOCK_MACRO_BEGIN { \
675 if(UTF_IS_FIRST_SURROGATE(c)) { \
677 if((i)<(length) && UTF_IS_SECOND_SURROGATE(__c2=(s)[(i)])) { \
679 (c)=UTF16_GET_PAIR_VALUE((c), __c2); \
683 (c)=UTF_ERROR_VALUE; \
685 } else if((strict) && !UTF_IS_UNICODE_CHAR(c)) { \
687 (c)=UTF_ERROR_VALUE; \
689 } UPRV_BLOCK_MACRO_END
692 #define UTF16_APPEND_CHAR_SAFE(s, i, length, c) UPRV_BLOCK_MACRO_BEGIN { \
693 if((uint32_t)(c)<=0xffff) { \
694 (s)[(i)++]=(uint16_t)(c); \
695 } else if((uint32_t)(c)<=0x10ffff) { \
696 if((i)+1<(length)) { \
697 (s)[(i)++]=(uint16_t)(((c)>>10)+0xd7c0); \
698 (s)[(i)++]=(uint16_t)(((c)&0x3ff)|0xdc00); \
700 (s)[(i)++]=UTF_ERROR_VALUE; \
703 (s)[(i)++]=UTF_ERROR_VALUE; \
705 } UPRV_BLOCK_MACRO_END
708 #define UTF16_FWD_1_SAFE(s, i, length) U16_FWD_1(s, i, length)
711 #define UTF16_FWD_N_SAFE(s, i, length, n) U16_FWD_N(s, i, length, n)
714 #define UTF16_SET_CHAR_START_SAFE(s, start, i) U16_SET_CP_START(s, start, i)
717 #define UTF16_PREV_CHAR_UNSAFE(s, i, c) UPRV_BLOCK_MACRO_BEGIN { \
719 if(UTF_IS_SECOND_SURROGATE(c)) { \
720 (c)=UTF16_GET_PAIR_VALUE((s)[--(i)], (c)); \
722 } UPRV_BLOCK_MACRO_END
725 #define UTF16_BACK_1_UNSAFE(s, i) UPRV_BLOCK_MACRO_BEGIN { \
726 if(UTF_IS_SECOND_SURROGATE((s)[--(i)])) { \
729 } UPRV_BLOCK_MACRO_END
732 #define UTF16_BACK_N_UNSAFE(s, i, n) UPRV_BLOCK_MACRO_BEGIN { \
735 UTF16_BACK_1_UNSAFE(s, i); \
738 } UPRV_BLOCK_MACRO_END
741 #define UTF16_SET_CHAR_LIMIT_UNSAFE(s, i) UPRV_BLOCK_MACRO_BEGIN { \
742 if(UTF_IS_FIRST_SURROGATE((s)[(i)-1])) { \
745 } UPRV_BLOCK_MACRO_END
748 #define UTF16_PREV_CHAR_SAFE(s, start, i, c, strict) UPRV_BLOCK_MACRO_BEGIN { \
750 if(UTF_IS_SECOND_SURROGATE(c)) { \
752 if((i)>(start) && UTF_IS_FIRST_SURROGATE(__c2=(s)[(i)-1])) { \
754 (c)=UTF16_GET_PAIR_VALUE(__c2, (c)); \
758 (c)=UTF_ERROR_VALUE; \
760 } else if((strict) && !UTF_IS_UNICODE_CHAR(c)) { \
762 (c)=UTF_ERROR_VALUE; \
764 } UPRV_BLOCK_MACRO_END
767 #define UTF16_BACK_1_SAFE(s, start, i) U16_BACK_1(s, start, i)
770 #define UTF16_BACK_N_SAFE(s, start, i, n) U16_BACK_N(s, start, i, n)
773 #define UTF16_SET_CHAR_LIMIT_SAFE(s, start, i, length) U16_SET_CP_LIMIT(s, start, i, length)
793 #define UTF32_IS_SAFE(c, strict) \
795 (uint32_t)(c)<=0x10ffff : \
796 UTF_IS_UNICODE_CHAR(c))
809 #define UTF32_IS_SINGLE(uchar) 1
811 #define UTF32_IS_LEAD(uchar) 0
813 #define UTF32_IS_TRAIL(uchar) 0
818 #define UTF32_NEED_MULTIPLE_UCHAR(c) 0
820 #define UTF32_CHAR_LENGTH(c) 1
822 #define UTF32_MAX_CHAR_LENGTH 1
827 #define UTF32_ARRAY_SIZE(size) (size)
830 #define UTF32_GET_CHAR_UNSAFE(s, i, c) UPRV_BLOCK_MACRO_BEGIN { \
832 } UPRV_BLOCK_MACRO_END
835 #define UTF32_GET_CHAR_SAFE(s, start, i, length, c, strict) UPRV_BLOCK_MACRO_BEGIN { \
837 if(!UTF32_IS_SAFE(c, strict)) { \
838 (c)=UTF_ERROR_VALUE; \
840 } UPRV_BLOCK_MACRO_END
845 #define UTF32_NEXT_CHAR_UNSAFE(s, i, c) UPRV_BLOCK_MACRO_BEGIN { \
847 } UPRV_BLOCK_MACRO_END
850 #define UTF32_APPEND_CHAR_UNSAFE(s, i, c) UPRV_BLOCK_MACRO_BEGIN { \
852 } UPRV_BLOCK_MACRO_END
855 #define UTF32_FWD_1_UNSAFE(s, i) UPRV_BLOCK_MACRO_BEGIN { \
857 } UPRV_BLOCK_MACRO_END
860 #define UTF32_FWD_N_UNSAFE(s, i, n) UPRV_BLOCK_MACRO_BEGIN { \
862 } UPRV_BLOCK_MACRO_END
865 #define UTF32_SET_CHAR_START_UNSAFE(s, i) UPRV_BLOCK_MACRO_BEGIN { \
866 } UPRV_BLOCK_MACRO_END
869 #define UTF32_NEXT_CHAR_SAFE(s, i, length, c, strict) UPRV_BLOCK_MACRO_BEGIN { \
871 if(!UTF32_IS_SAFE(c, strict)) { \
872 (c)=UTF_ERROR_VALUE; \
874 } UPRV_BLOCK_MACRO_END
877 #define UTF32_APPEND_CHAR_SAFE(s, i, length, c) UPRV_BLOCK_MACRO_BEGIN { \
878 if((uint32_t)(c)<=0x10ffff) { \
883 } UPRV_BLOCK_MACRO_END
886 #define UTF32_FWD_1_SAFE(s, i, length) UPRV_BLOCK_MACRO_BEGIN { \
888 } UPRV_BLOCK_MACRO_END
891 #define UTF32_FWD_N_SAFE(s, i, length, n) UPRV_BLOCK_MACRO_BEGIN { \
892 if(((i)+=(n))>(length)) { \
895 } UPRV_BLOCK_MACRO_END
898 #define UTF32_SET_CHAR_START_SAFE(s, start, i) UPRV_BLOCK_MACRO_BEGIN { \
899 } UPRV_BLOCK_MACRO_END
904 #define UTF32_PREV_CHAR_UNSAFE(s, i, c) UPRV_BLOCK_MACRO_BEGIN { \
906 } UPRV_BLOCK_MACRO_END
909 #define UTF32_BACK_1_UNSAFE(s, i) UPRV_BLOCK_MACRO_BEGIN { \
911 } UPRV_BLOCK_MACRO_END
914 #define UTF32_BACK_N_UNSAFE(s, i, n) UPRV_BLOCK_MACRO_BEGIN { \
916 } UPRV_BLOCK_MACRO_END
919 #define UTF32_SET_CHAR_LIMIT_UNSAFE(s, i) UPRV_BLOCK_MACRO_BEGIN { \
920 } UPRV_BLOCK_MACRO_END
923 #define UTF32_PREV_CHAR_SAFE(s, start, i, c, strict) UPRV_BLOCK_MACRO_BEGIN { \
925 if(!UTF32_IS_SAFE(c, strict)) { \
926 (c)=UTF_ERROR_VALUE; \
928 } UPRV_BLOCK_MACRO_END
931 #define UTF32_BACK_1_SAFE(s, start, i) UPRV_BLOCK_MACRO_BEGIN { \
933 } UPRV_BLOCK_MACRO_END
936 #define UTF32_BACK_N_SAFE(s, start, i, n) UPRV_BLOCK_MACRO_BEGIN { \
941 } UPRV_BLOCK_MACRO_END
944 #define UTF32_SET_CHAR_LIMIT_SAFE(s, i, length) UPRV_BLOCK_MACRO_BEGIN { \
945 } UPRV_BLOCK_MACRO_END
954 #define UTF_ARRAY_SIZE(size) UTF16_ARRAY_SIZE(size)
957 #define UTF_GET_CHAR_UNSAFE(s, i, c) UTF16_GET_CHAR_UNSAFE(s, i, c)
960 #define UTF_GET_CHAR_SAFE(s, start, i, length, c, strict) UTF16_GET_CHAR_SAFE(s, start, i, length, c, strict)
964 #define UTF_NEXT_CHAR_UNSAFE(s, i, c) UTF16_NEXT_CHAR_UNSAFE(s, i, c)
967 #define UTF_NEXT_CHAR_SAFE(s, i, length, c, strict) UTF16_NEXT_CHAR_SAFE(s, i, length, c, strict)
971 #define UTF_APPEND_CHAR_UNSAFE(s, i, c) UTF16_APPEND_CHAR_UNSAFE(s, i, c)
974 #define UTF_APPEND_CHAR_SAFE(s, i, length, c) UTF16_APPEND_CHAR_SAFE(s, i, length, c)
978 #define UTF_FWD_1_UNSAFE(s, i) UTF16_FWD_1_UNSAFE(s, i)
981 #define UTF_FWD_1_SAFE(s, i, length) UTF16_FWD_1_SAFE(s, i, length)
985 #define UTF_FWD_N_UNSAFE(s, i, n) UTF16_FWD_N_UNSAFE(s, i, n)
988 #define UTF_FWD_N_SAFE(s, i, length, n) UTF16_FWD_N_SAFE(s, i, length, n)
992 #define UTF_SET_CHAR_START_UNSAFE(s, i) UTF16_SET_CHAR_START_UNSAFE(s, i)
995 #define UTF_SET_CHAR_START_SAFE(s, start, i) UTF16_SET_CHAR_START_SAFE(s, start, i)
999 #define UTF_PREV_CHAR_UNSAFE(s, i, c) UTF16_PREV_CHAR_UNSAFE(s, i, c)
1002 #define UTF_PREV_CHAR_SAFE(s, start, i, c, strict) UTF16_PREV_CHAR_SAFE(s, start, i, c, strict)
1006 #define UTF_BACK_1_UNSAFE(s, i) UTF16_BACK_1_UNSAFE(s, i)
1009 #define UTF_BACK_1_SAFE(s, start, i) UTF16_BACK_1_SAFE(s, start, i)
1013 #define UTF_BACK_N_UNSAFE(s, i, n) UTF16_BACK_N_UNSAFE(s, i, n)
1016 #define UTF_BACK_N_SAFE(s, start, i, n) UTF16_BACK_N_SAFE(s, start, i, n)
1020 #define UTF_SET_CHAR_LIMIT_UNSAFE(s, i) UTF16_SET_CHAR_LIMIT_UNSAFE(s, i)
1023 #define UTF_SET_CHAR_LIMIT_SAFE(s, start, i, length) UTF16_SET_CHAR_LIMIT_SAFE(s, start, i, length)
1032 #define UTF_IS_SINGLE(uchar) U16_IS_SINGLE(uchar)
1039 #define UTF_IS_LEAD(uchar) U16_IS_LEAD(uchar)
1046 #define UTF_IS_TRAIL(uchar) U16_IS_TRAIL(uchar)
1053 #define UTF_NEED_MULTIPLE_UCHAR(c) UTF16_NEED_MULTIPLE_UCHAR(c)
1060 #define UTF_CHAR_LENGTH(c) U16_LENGTH(c)
1067 #define UTF_MAX_CHAR_LENGTH U16_MAX_LENGTH
1078 #define UTF_GET_CHAR(s, start, i, length, c) U16_GET(s, start, i, length, c)
1091 #define UTF_NEXT_CHAR(s, i, length, c) U16_NEXT(s, i, length, c)
1104 #define UTF_APPEND_CHAR(s, i, length, c) UTF16_APPEND_CHAR_SAFE(s, i, length, c)
1115 #define UTF_FWD_1(s, i, length) U16_FWD_1(s, i, length)
1126 #define UTF_FWD_N(s, i, length, n) U16_FWD_N(s, i, length, n)
1142 #define UTF_SET_CHAR_START(s, start, i) U16_SET_CP_START(s, start, i)
1155 #define UTF_PREV_CHAR(s, start, i, c) U16_PREV(s, start, i, c)
1168 #define UTF_BACK_1(s, start, i) U16_BACK_1(s, start, i)
1181 #define UTF_BACK_N(s, start, i, n) U16_BACK_N(s, start, i, n)
1197 #define UTF_SET_CHAR_LIMIT(s, start, i, length) U16_SET_CP_LIMIT(s, start, i, length)
#define U_CAPI
This is used to declare a function as a public ICU C API.
#define U_CFUNC
This is used in a declaration of a library private ICU C function.
C API: 16-bit Unicode handling macros.
C API: 8-bit Unicode handling macros.
C API: Code point macros.
U_CFUNC U_IMPORT const uint8_t utf8_countTrailBytes[]
Internal array with numbers of trail bytes for any given byte used in lead byte position.