summaryrefslogtreecommitdiff
path: root/src/mbgl/util/utf.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/util/utf.hpp')
-rw-r--r--src/mbgl/util/utf.hpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mbgl/util/utf.hpp b/src/mbgl/util/utf.hpp
new file mode 100644
index 0000000000..d6ba2a1f2f
--- /dev/null
+++ b/src/mbgl/util/utf.hpp
@@ -0,0 +1,24 @@
+#ifndef MBGL_UTIL_UTF
+#define MBGL_UTIL_UTF
+
+#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);
+ }
+};
+
+}}
+
+#endif