aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/str_util.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-12-03 11:30:22 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-12-03 11:30:22 +0000
commitb4442b41baab6160e87098f52b94def24b97e066 (patch)
tree5361f47875c1399c0c8a0836e9c74475af0ae459 /src/libutil/str_util.h
parentfe940c7d3d9d72f0196b9cd847dd0160603dcbe9 (diff)
downloadrspamd-b4442b41baab6160e87098f52b94def24b97e066.tar.gz
rspamd-b4442b41baab6160e87098f52b94def24b97e066.zip
[Minor] Add rspamd_str_make_utf_valid routine + unit tests
Diffstat (limited to 'src/libutil/str_util.h')
-rw-r--r--src/libutil/str_util.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libutil/str_util.h b/src/libutil/str_util.h
index 688034ec6..139a85416 100644
--- a/src/libutil/str_util.h
+++ b/src/libutil/str_util.h
@@ -419,4 +419,14 @@ gchar *
rspamd_str_regexp_escape (const gchar *pattern, gsize slen,
gsize *dst_len, enum rspamd_regexp_escape_flags flags);
+/**
+ * Returns copy of src (zero terminated) where all unicode is made valid or replaced
+ * to FFFD characters. Caller must free string after usage
+ * @param src
+ * @param slen
+ * @param dstelen
+ * @return
+ */
+gchar * rspamd_str_make_utf_valid (const gchar *src, gsize slen, gsize *dstlen);
+
#endif /* SRC_LIBUTIL_STR_UTIL_H_ */