summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib
diff options
context:
space:
mode:
author npwoods <npwoods@alumni.cmu.edu>2017-07-30 01:16:45 -0400
committer Vas Crabb <cuavas@users.noreply.github.com>2017-07-30 15:16:45 +1000
commitaca90520de001f09ac1bc6863028ae4bc8988db5 (patch)
treef319c7afcfc450a7b5490a4fb21c959f43506ac8 /src/lib
parent3076e3a22b67966f8947e1a11b2ff30c6c2ccfa1 (diff)
Imgtool: Merged normalize_filename() into cannonicalize_path(), C++-ification (#2527)
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/util/unicode.cpp22
-rw-r--r--src/lib/util/unicode.h4
2 files changed, 26 insertions, 0 deletions
diff --git a/src/lib/util/unicode.cpp b/src/lib/util/unicode.cpp
index b48cef44c79..ed0f336d275 100644
--- a/src/lib/util/unicode.cpp
+++ b/src/lib/util/unicode.cpp
@@ -469,6 +469,28 @@ std::string normalize_unicode(const char *s, size_t length, unicode_normalizatio
//-------------------------------------------------
+// uchar_toupper - uses utf8proc to convert to
+// upper case
+//-------------------------------------------------
+
+char32_t uchar_toupper(char32_t ch)
+{
+ return utf8proc_toupper(ch);
+}
+
+
+//-------------------------------------------------
+// uchar_tolower - uses utf8proc to convert to
+// lower case
+//-------------------------------------------------
+
+char32_t uchar_tolower(char32_t ch)
+{
+ return utf8proc_tolower(ch);
+}
+
+
+//-------------------------------------------------
// utf8_previous_char - return a pointer to the
// previous character in a string
//-------------------------------------------------
diff --git a/src/lib/util/unicode.h b/src/lib/util/unicode.h
index 8a1180dcc92..5e30a74916e 100644
--- a/src/lib/util/unicode.h
+++ b/src/lib/util/unicode.h
@@ -111,6 +111,10 @@ std::string normalize_unicode(const std::string &s, unicode_normalization_form n
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);
+// upper and lower case
+char32_t uchar_toupper(char32_t ch);
+char32_t uchar_tolower(char32_t ch);
+
// misc UTF-8 helpers
const char *utf8_previous_char(const char *utf8string);
bool utf8_is_valid_string(const char *utf8string);