]> git.ipfire.org Git - thirdparty/dovecot/core.git/commit
lib: Implement str_sanitize_utf8(). 79/head
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sat, 14 Apr 2018 00:05:51 +0000 (02:05 +0200)
committerStephan Bosch <stephan.bosch@dovecot.fi>
Tue, 17 Apr 2018 19:40:12 +0000 (21:40 +0200)
commita2de39bad6420dae9b9f2b57a67685f40cf0b056
treecb79c44ed8f1843a56579912715d4634fba3832c
parent0ec60a15b1158a67abde5b18039422cbd545ec61
lib: Implement str_sanitize_utf8().

Unlike str_sanitize(), this function truncates strings based on a UTF8 code point
limit rather than a maximum size in bytes. Also, the Unicode replacement
character is used to mark invalid/control characters and an ellipsis character
is used to indicate the string truncation. For the normal str_sanitize() this is
done using a question mark and triple dots respectively.
src/lib/str-sanitize.c
src/lib/str-sanitize.h
src/lib/test-str-sanitize.c