diff options
author | Thiago Marcos P. Santos <thiago@mapbox.com> | 2016-12-20 15:06:56 -0200 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2017-01-20 18:50:45 +0100 |
commit | 181b3635f17101672c05af3e0800d7841fd259e8 (patch) | |
tree | c24b830459b7ac11c844c1d369a99579685d9ebb /platform/default | |
parent | cbf28083e61a1bda85765db610ae93291d077086 (diff) | |
download | qtlocation-mapboxgl-181b3635f17101672c05af3e0800d7841fd259e8.tar.gz |
[core][Qt] Use Qt for UTF16, since `codecvt` is not always available
Diffstat (limited to 'platform/default')
-rw-r--r-- | platform/default/utf.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/platform/default/utf.cpp b/platform/default/utf.cpp new file mode 100644 index 0000000000..ba9678c91f --- /dev/null +++ b/platform/default/utf.cpp @@ -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 |