diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2018-10-18 17:33:27 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2018-10-23 12:23:40 +0200 |
commit | 282c71e8e9a8ec9c2eab612f2e60a71b15d24c8a (patch) | |
tree | 2d5a7d0f9b054af2686fe94dfa8c5690e8c92e72 /src | |
parent | 729eeeb3f821981cc5d3c9e06ffbb85ed4d857d7 (diff) | |
download | qtlocation-mapboxgl-282c71e8e9a8ec9c2eab612f2e60a71b15d24c8a.tar.gz |
[core] unify UTF-8/16 conversion to <boost/locale/encoding_utf.hpp>
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/layout/symbol_layout.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/util/i18n.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/util/utf.hpp | 6 |
3 files changed, 4 insertions, 6 deletions
diff --git a/src/mbgl/layout/symbol_layout.cpp b/src/mbgl/layout/symbol_layout.cpp index f7b6d949bd..6d20afeb8d 100644 --- a/src/mbgl/layout/symbol_layout.cpp +++ b/src/mbgl/layout/symbol_layout.cpp @@ -123,7 +123,7 @@ SymbolLayout::SymbolLayout(const BucketParameters& parameters, u8string = platform::lowercase(u8string); } - ft.formattedText->addSection(applyArabicShaping(util::utf8_to_utf16::convert(u8string)), + ft.formattedText->addSection(applyArabicShaping(util::convertUTF8ToUTF16(u8string)), section.fontScale ? *section.fontScale : 1.0, section.fontStack ? FontStackHasher()(*section.fontStack) : baseFontStackHash); diff --git a/src/mbgl/util/i18n.cpp b/src/mbgl/util/i18n.cpp index 66c9e027a7..d9b0c20796 100644 --- a/src/mbgl/util/i18n.cpp +++ b/src/mbgl/util/i18n.cpp @@ -609,7 +609,7 @@ bool charInSupportedScript(char16_t chr) { } bool isStringInSupportedScript(const std::string& input) { - auto u16string = util::utf8_to_utf16::convert(input); + auto u16string = util::convertUTF8ToUTF16(input); for (char16_t chr : u16string) { if (!charInSupportedScript(chr)) { return false; diff --git a/src/mbgl/util/utf.hpp b/src/mbgl/util/utf.hpp index c13b094371..d870fb9331 100644 --- a/src/mbgl/util/utf.hpp +++ b/src/mbgl/util/utf.hpp @@ -5,10 +5,8 @@ namespace mbgl { namespace util { -class utf8_to_utf16 { -public: - static std::u16string convert(std::string const&); -}; +std::u16string convertUTF8ToUTF16(const std::string&); +std::string convertUTF16ToUTF8(const std::u16string&); } // namespace util } // namespace mbgl |