diff --git a/src/utils/string_utils.cpp b/src/utils/string_utils.cpp index 546bf2149..3ba36fa43 100644 --- a/src/utils/string_utils.cpp +++ b/src/utils/string_utils.cpp @@ -698,7 +698,15 @@ namespace StringUtils } // wideToUtf8 // ------------------------------------------------------------------------ + /** Converts the irrlicht wide string to an utf8-encoded std::string. + */ + std::string wideToUtf8(const irr::core::stringw& input) + { + return wideToUtf8(input.c_str()); + } // wideToUtf8 + // ------------------------------------------------------------------------ + /** Converts the irrlicht wide string to an utf8-encoded std::string. */ irr::core::stringw utf8ToWide(const char* input) { static std::vector utf16line; @@ -710,6 +718,13 @@ namespace StringUtils return irr::core::stringw(&utf16line[0]); } // utf8ToWide + // ------------------------------------------------------------------------ + /** Converts a utf8-encoded std::string into an irrlicht wide string. */ + irr::core::stringw utf8ToWide(const std::string &input) + { + return utf8ToWide(input.c_str()); + } // utf8ToWide + // ------------------------------------------------------------------------ /** Converts a version string (in the form of 'X.Y.Za-rcU' into an * integer number. diff --git a/src/utils/string_utils.hpp b/src/utils/string_utils.hpp index f60f2e9c4..ca5b65d6d 100644 --- a/src/utils/string_utils.hpp +++ b/src/utils/string_utils.hpp @@ -227,19 +227,9 @@ namespace StringUtils // ------------------------------------------------------------------------ irr::core::stringw utf8ToWide(const char* input); + irr::core::stringw utf8ToWide(const std::string &input); std::string wideToUtf8(const wchar_t* input); - // ------------------------------------------------------------------------ - /** Converts a utf8-encoded std::string into an irrlicht wide string. */ - static irr::core::stringw utf8ToWide(const std::string &input) - { - return utf8ToWide(input.c_str()); - } // utf8ToWide - // ------------------------------------------------------------------------ - /** Converts the irrlicht wide string to an utf8-encoded std::string. */ - static std::string wideToUtf8(const irr::core::stringw& input) - { - return wideToUtf8(input.c_str()); - } // wideToUtf8 + std::string wideToUtf8(const irr::core::stringw& input); } // namespace StringUtils