#include "bench_framework.hpp" #include #include class test : public benchmark::test_case { std::string expr_; public: test(mapnik::parameters const& params) : test_case(params), expr_("this is a fairly long string that might contain unicode") {} bool validate() const { mapnik::transcoder tr_("utf-8"); mapnik::value_unicode_string ustr = tr_.transcode(expr_.data(),expr_.size()); std::string utf8; mapnik::to_utf8(ustr,utf8); return utf8 == expr_; } void operator()() const { mapnik::transcoder tr_("utf-8"); mapnik::value_unicode_string ustr; for (std::size_t i=0;i