]> git.ipfire.org Git - thirdparty/dovecot/core.git/commit
lib: Implement str_sanitize_utf8().
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sat, 14 Apr 2018 00:05:51 +0000 (02:05 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Fri, 27 Apr 2018 10:18:20 +0000 (13:18 +0300)
commitb1b531b3720961b87cd94975341a941bc3406d58
tree3406ca9f83614ff8b3ae5e6dbd78543e158a9ffa
parente182a2587f69122029c7236d464e11e53ca8c8df
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