[core][Qt] Use Qt for UTF16, since codecvt is not always available

This commit is contained in:
Thiago Marcos P. Santos
2016-12-20 15:06:56 -02:00
committed by Thiago Marcos P. Santos
parent cbf28083e6
commit 181b3635f1
8 changed files with 40 additions and 8 deletions

16
platform/default/utf.cpp Normal file
View 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