diff options
author | 2016-12-31 09:07:40 -0500 | |
---|---|---|
committer | 2016-12-31 11:17:07 -0500 | |
commit | 5be1b8e6e044cbd13ccc3e8fbbeab00ec576784b (patch) | |
tree | c11f8471b7b6868d26721e4cb53edeec94b46bae /src/lib/util/unicode.h | |
parent | 11a44f2c75044add678d5fcae40365ba873ff6ff (diff) |
Introduced utf8proc and created wrapper code to expose a prettier API
Diffstat (limited to 'src/lib/util/unicode.h')
-rw-r--r-- | src/lib/util/unicode.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/util/unicode.h b/src/lib/util/unicode.h index 5cc6db383ee..ef5267794e6 100644 --- a/src/lib/util/unicode.h +++ b/src/lib/util/unicode.h @@ -72,6 +72,9 @@ #define UTF8_UP "\xe2\x86\x91" /* cursor up */ #define UTF8_DOWN "\xe2\x86\x93" /* cursor down */ +enum class unicode_normalization_form { C, D, KC, KD }; + + /*************************************************************************** FUNCTION PROTOTYPES @@ -97,6 +100,11 @@ std::string utf8_from_uchar(char32_t uchar); int utf16_from_uchar(char16_t *utf16string, size_t count, char32_t uchar); int utf16f_from_uchar(char16_t *utf16string, size_t count, char32_t uchar); +// unicode normalization +std::string normalize_unicode(const std::string &s, unicode_normalization_form normalization_form); +std::string normalize_unicode(const char *s, unicode_normalization_form normalization_form); +std::string normalize_unicode(const char *s, size_t length, unicode_normalization_form normalization_form); + // misc UTF-8 helpers const char *utf8_previous_char(const char *utf8string); bool utf8_is_valid_string(const char *utf8string); |