diff --git a/src/lib/base/Unicode.cpp b/src/lib/base/Unicode.cpp index 36167e670..47dacd9a3 100644 --- a/src/lib/base/Unicode.cpp +++ b/src/lib/base/Unicode.cpp @@ -171,32 +171,6 @@ std::string Unicode::UTF8ToUTF16(const std::string &src, bool *errors) return dst; } -std::string Unicode::UTF8ToUTF32(const std::string &src, bool *errors) -{ - // default to success - resetError(errors); - - // get size of input string and reserve some space in output - auto n = (uint32_t)src.size(); - std::string dst; - dst.reserve(4 * n); - - // convert each character - const auto *data = reinterpret_cast(src.c_str()); - while (n > 0) { - uint32_t c = fromUTF8(data, n); - if (c == s_invalid) { - c = s_replacement; - } else if (c >= 0x00110000) { - setError(errors); - c = s_replacement; - } - dst.append(reinterpret_cast(&c), 4); - } - - return dst; -} - std::string Unicode::UCS2ToUTF8(const std::string_view &src, bool *errors) { // default to success diff --git a/src/lib/base/Unicode.h b/src/lib/base/Unicode.h index 0a2b53926..43b37778d 100644 --- a/src/lib/base/Unicode.h +++ b/src/lib/base/Unicode.h @@ -52,14 +52,6 @@ public: */ static std::string UTF8ToUTF16(const std::string &, bool *errors = nullptr); - //! Convert from UTF-8 to UTF-32 encoding - /*! - Convert from UTF-8 to UTF-32. If errors is not nullptr then *errors - is set to true iff any character could not be encoded in UTF-32. - Decoding errors do not set *errors. - */ - static std::string UTF8ToUTF32(const std::string &, bool *errors = nullptr); - //! Convert from UCS-2 to UTF-8 /*! Convert from UCS-2 to UTF-8. If errors is not nullptr then *errors is