core: rename mbgl directories to mln (#4511)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
24
platform/default/src/mln/util/utf.cpp
Normal file
24
platform/default/src/mln/util/utf.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include <mln/util/utf.hpp>
|
||||
|
||||
#include <locale>
|
||||
#include <codecvt>
|
||||
|
||||
namespace mln {
|
||||
namespace util {
|
||||
|
||||
std::u16string convertUTF8ToUTF16(const std::string& str) {
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t>
|
||||
conv; // NOLINT(clang-diagnostic-deprecated-declarations)
|
||||
|
||||
return conv.from_bytes(str);
|
||||
}
|
||||
|
||||
std::string convertUTF16ToUTF8(const std::u16string& str) {
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t>
|
||||
conv; // NOLINT(clang-diagnostic-deprecated-declarations)
|
||||
|
||||
return conv.to_bytes(str);
|
||||
}
|
||||
|
||||
} // namespace util
|
||||
} // namespace mln
|
||||
Reference in New Issue
Block a user