diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-05-05 17:35:13 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-05-05 17:35:13 +0100 |
commit | 7f7e0530304343e9ada79844892f57b0a0a7b422 (patch) | |
tree | e529a3a8656ae7162db3aa165c154af05278d452 /src/libutil | |
parent | 9d0a7d7b982e59b1845ae3e65bee22be0c9bb7d3 (diff) | |
download | rspamd-7f7e0530304343e9ada79844892f57b0a0a7b422.tar.gz rspamd-7f7e0530304343e9ada79844892f57b0a0a7b422.zip |
[Minor] Lua_util: Add normalize_utf8 utility
Issue: #4475
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/cxx/utf8_util.cxx | 4 | ||||
-rw-r--r-- | src/libutil/cxx/utf8_util.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/libutil/cxx/utf8_util.cxx b/src/libutil/cxx/utf8_util.cxx index dadd5fc6e..8d9fc31a9 100644 --- a/src/libutil/cxx/utf8_util.cxx +++ b/src/libutil/cxx/utf8_util.cxx @@ -75,7 +75,7 @@ rspamd_string_unicode_trim_inplace (const char *str, size_t *len) return ret; } -enum rspamd_normalise_result +enum rspamd_utf8_normalise_result rspamd_normalise_unicode_inplace(char *start, size_t *len) { UErrorCode uc_err = U_ZERO_ERROR; @@ -156,7 +156,7 @@ rspamd_normalise_unicode_inplace(char *start, size_t *len) *len = filter_zw_spaces_and_push_back(uc_string); } - return static_cast<enum rspamd_normalise_result>(ret); + return static_cast<enum rspamd_utf8_normalise_result>(ret); } struct rspamd_icu_collate_storage { diff --git a/src/libutil/cxx/utf8_util.h b/src/libutil/cxx/utf8_util.h index a9476f78d..da4ebdb24 100644 --- a/src/libutil/cxx/utf8_util.h +++ b/src/libutil/cxx/utf8_util.h @@ -34,7 +34,7 @@ extern "C" { */ const char* rspamd_string_unicode_trim_inplace (const char *str, size_t *len); -enum rspamd_normalise_result { +enum rspamd_utf8_normalise_result { RSPAMD_UNICODE_NORM_NORMAL = 0, RSPAMD_UNICODE_NORM_UNNORMAL = (1 << 0), RSPAMD_UNICODE_NORM_ZERO_SPACES = (1 << 1), @@ -49,7 +49,7 @@ enum rspamd_normalise_result { * @param len * @return TRUE if a string has been normalised */ -enum rspamd_normalise_result rspamd_normalise_unicode_inplace(gchar *start, gsize *len); +enum rspamd_utf8_normalise_result rspamd_normalise_unicode_inplace(gchar *start, gsize *len); /** * Compare two strings using libicu collator |