| 743 | } |
| 744 | |
| 745 | UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_reencode(utf8proc_int32_t *buffer, utf8proc_ssize_t length, utf8proc_option_t options) { |
| 746 | /* UTF8PROC_NULLTERM option will be ignored, 'length' is never ignored |
| 747 | ASSERT: 'buffer' has one spare byte of free space at the end! */ |
| 748 | length = utf8proc_normalize_utf32(buffer, length, options); |
| 749 | if (length < 0) return length; |
| 750 | { |
| 751 | utf8proc_ssize_t rpos, wpos = 0; |
| 752 | utf8proc_int32_t uc; |
| 753 | if (options & UTF8PROC_CHARBOUND) { |
| 754 | for (rpos = 0; rpos < length; rpos++) { |
| 755 | uc = buffer[rpos]; |
| 756 | wpos += charbound_encode_char(uc, ((utf8proc_uint8_t *)buffer) + wpos); |
| 757 | } |
| 758 | } else { |
| 759 | for (rpos = 0; rpos < length; rpos++) { |
| 760 | uc = buffer[rpos]; |
| 761 | wpos += utf8proc_encode_char(uc, ((utf8proc_uint8_t *)buffer) + wpos); |
| 762 | } |
| 763 | } |
| 764 | ((utf8proc_uint8_t *)buffer)[wpos] = 0; |
| 765 | return wpos; |
| 766 | } |
| 767 | } |
| 768 | |
| 769 | UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_map( |
| 770 | const utf8proc_uint8_t *str, utf8proc_ssize_t strlen, utf8proc_uint8_t **dstptr, utf8proc_option_t options |
no test coverage detected