diff options
author | artemp <artem@mapnik.org> | 2014-10-30 17:42:50 -0400 |
---|---|---|
committer | artemp <artem@mapnik.org> | 2014-10-30 17:43:55 -0400 |
commit | 19556009043d58dec3c96a5da6b962c6dcf249e9 (patch) | |
tree | 836ff4f1703331057d3b56a6030c3cd0432bf00d /include | |
parent | 203acaad9e654680e62c3bab1c3fe27b64009007 (diff) | |
download | qtlocation-mapboxgl-19556009043d58dec3c96a5da6b962c6dcf249e9.tar.gz |
use boost::unicode_iterator on all platform (experimental)
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/util/utf.hpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/include/mbgl/util/utf.hpp b/include/mbgl/util/utf.hpp index bb63179123..ddf0ff3069 100644 --- a/include/mbgl/util/utf.hpp +++ b/include/mbgl/util/utf.hpp @@ -4,10 +4,11 @@ #include <memory> // g++/libstdc++ is missing c++11 codecvt support -#if ! defined(__clang__) || defined(__linux__) +#if 1//! defined(__clang__) || defined(__linux__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-local-typedefs" -#include <boost/locale.hpp> +//#include <boost/locale.hpp> +#include <boost/regex/pending/unicode_iterator.hpp> #pragma GCC diagnostic pop #else // Assume that codecvt is present on clang on non-linux systems @@ -19,13 +20,16 @@ namespace mbgl { namespace util { -#if ! defined(__clang__) || defined(__linux__) +#if 1 //! defined(__clang__) || defined(__linux__) class utf8_to_utf32 { public: explicit utf8_to_utf32() {} - std::u32string convert(std::string const& utf8) { - return boost::locale::conv::utf_to_utf<char32_t>(utf8); + 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); } }; |