diff options
author | João Valverde <j@v6e.pt> | 2023-02-06 17:46:35 +0000 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2023-02-08 11:21:19 +0000 |
commit | eda38f5f2de12268347093c64de4c93d18c70515 (patch) | |
tree | 927b0c3105d5f3a24aa59bf60334a5e11c903ef4 /wsutil/unicode-utils.h | |
parent | a66b5080c38dc9d270e1ecde38c47b3545e761c8 (diff) |
Replace g_utf8_make_valid() with own function
The function ws_utf8_make_valid() is all-around better and
also does maximal substitution of subparts.
Diffstat (limited to 'wsutil/unicode-utils.h')
-rw-r--r-- | wsutil/unicode-utils.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/wsutil/unicode-utils.h b/wsutil/unicode-utils.h index 7303f607e0..7c85614bbe 100644 --- a/wsutil/unicode-utils.h +++ b/wsutil/unicode-utils.h @@ -70,6 +70,12 @@ int ws_utf8_seqlen[256]; WS_DLL_PUBLIC guint8 * ws_utf8_make_valid(wmem_allocator_t *scope, const guint8 *ptr, ssize_t length); +/* + * Same as ws_utf8_make_valid() but returns a wmem_strbuf_t. + */ +WS_DLL_PUBLIC wmem_strbuf_t * +ws_utf8_make_valid_strbuf(wmem_allocator_t *scope, const guint8 *ptr, ssize_t length); + #ifdef _WIN32 /** Given a UTF-8 string, convert it to UTF-16. This is meant to be used |