diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2018-06-21 14:44:00 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2018-09-11 11:43:54 +0200 |
commit | 30e570aae7d2ba5522feafb962b334ef3f35459e (patch) | |
tree | 5a8f787197772ed302e1fbf45839d973feb80838 /platform/default/utf.cpp | |
parent | 536652ca201ce59190ae5c41d1202372d28d6d6d (diff) | |
download | qtlocation-mapboxgl-30e570aae7d2ba5522feafb962b334ef3f35459e.tar.gz |
[core] add polyfill for codecvt for STLs that don't have it yet
Diffstat (limited to 'platform/default/utf.cpp')
-rw-r--r-- | platform/default/utf.cpp | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/platform/default/utf.cpp b/platform/default/utf.cpp index 8fc44a9ed3..8bc8ea7314 100644 --- a/platform/default/utf.cpp +++ b/platform/default/utf.cpp @@ -1,25 +1,13 @@ #include <mbgl/util/utf.hpp> -#include <memory> #include <locale> - -// GCC 4.9 compatibility -#if !defined(__GNUC__) || __GNUC__ >= 5 #include <codecvt> -#else -#include <boost/locale/encoding_utf.hpp> -#endif namespace mbgl { namespace util { -std::u16string utf8_to_utf16::convert(std::string const& utf8) { -#if !defined(__GNUC__) || __GNUC__ >= 5 - std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> converter; - return converter.from_bytes(utf8); -#else - return boost::locale::conv::utf_to_utf<char16_t>(utf8.c_str(), utf8.c_str() + utf8.size()); -#endif +std::u16string utf8_to_utf16::convert(const std::string& utf8) { + return std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t>().from_bytes(utf8); } } // namespace util |