[core] unify UTF-8/16 conversion to <boost/locale/encoding_utf.hpp>
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user