summaryrefslogtreecommitdiff
path: root/src/mbgl/util/utf.hpp
blob: 386e56bef86c7584f17b20eb71acdc8608e1ee5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once

#include <memory>

#include <locale>
#include <codecvt>

namespace mbgl {
namespace util {

class utf8_to_utf16 {
public:
    static std::u16string 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