MCPcopy Index your code
hub / github.com/JuliaStrings/utf8proc / utf8proc_reencode

Function utf8proc_reencode

utf8proc.c:745–767  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

743}
744
745UTF8PROC_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
769UTF8PROC_DLLEXPORT utf8proc_ssize_t utf8proc_map(
770 const utf8proc_uint8_t *str, utf8proc_ssize_t strlen, utf8proc_uint8_t **dstptr, utf8proc_option_t options

Callers 1

utf8proc_map_customFunction · 0.85

Calls 3

utf8proc_normalize_utf32Function · 0.85
charbound_encode_charFunction · 0.85
utf8proc_encode_charFunction · 0.85

Tested by

no test coverage detected