[core][Qt] Use Qt for UTF16, since codecvt is not always available
This commit is contained in:
committed by
Thiago Marcos P. Santos
parent
cbf28083e6
commit
181b3635f1
16
platform/default/utf.cpp
Normal file
16
platform/default/utf.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <mbgl/util/utf.hpp>
|
||||
|
||||
#include <memory>
|
||||
#include <locale>
|
||||
#include <codecvt>
|
||||
|
||||
namespace mbgl {
|
||||
namespace util {
|
||||
|
||||
std::u16string utf8_to_utf16::convert(std::string const& utf8) {
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> converter;
|
||||
return converter.from_bytes(utf8);
|
||||
}
|
||||
|
||||
} // namespace util
|
||||
} // namespace mbgl
|
||||
Reference in New Issue
Block a user