diff options
Diffstat (limited to 'src/lib/util/unicode.cpp')
-rw-r--r-- | src/lib/util/unicode.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/lib/util/unicode.cpp b/src/lib/util/unicode.cpp index 4a83b675087..b3568fbb8d4 100644 --- a/src/lib/util/unicode.cpp +++ b/src/lib/util/unicode.cpp @@ -125,6 +125,17 @@ bool uchar_is_digit(char32_t uchar) // into a unicode character //----------------------------------------------- +int uchar_from_utf8(char32_t *uchar, std::string_view utf8str) +{ + return uchar_from_utf8(uchar, utf8str.data(), utf8str.length()); +} + + +//------------------------------------------------- +// uchar_from_utf8 - convert a UTF-8 sequence +// into a unicode character +//----------------------------------------------- + int uchar_from_utf8(char32_t *uchar, const char *utf8char, size_t count) { // validate parameters @@ -494,9 +505,9 @@ std::string normalize_unicode(const char *s, unicode_normalization_form normaliz // unicode //------------------------------------------------- -std::string normalize_unicode(const char *s, size_t length, unicode_normalization_form normalization_form, bool fold_case) +std::string normalize_unicode(std::string_view s, unicode_normalization_form normalization_form, bool fold_case) { - return internal_normalize_unicode(s, length, normalization_form, fold_case, false); + return internal_normalize_unicode(s.data(), s.length(), normalization_form, fold_case, false); } |