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

#include <memory>

#include <boost/regex/pending/unicode_iterator.hpp>

namespace mbgl {
namespace util {

class utf8_to_utf32 {
 public:
    static std::u32string convert(std::string const& utf8)
    {
        boost::u8_to_u32_iterator<std::string::const_iterator> begin(utf8.begin());
        boost::u8_to_u32_iterator<std::string::const_iterator> end(utf8.end());
        return std::u32string(begin,end);
    }
};

} // namespace mbgl
} // namespace util