value_type operator() (regex_replace_node const& x) const { value_type v = boost::apply_visitor(evaluate<feature_type,value_type>(feature_),x.expr); #if defined(BOOST_REGEX_HAS_ICU) return boost::u32regex_replace(v.to_unicode(),x.pattern,x.format); #else std::string repl = boost::regex_replace(v.to_string(),x.pattern,x.format); mapnik::transcoder tr_("utf8"); return tr_.transcode(repl.c_str()); #endif }
value regex_replace_node::apply(value const& v) const { auto const& pattern = impl_.get()->pattern_; auto const& format = impl_.get()->format_; #if defined(BOOST_REGEX_HAS_ICU) return boost::u32regex_replace(v.to_unicode(),pattern,format); #else std::string repl = boost::regex_replace(v.to_string(),pattern,format); transcoder tr_("utf8"); return tr_.transcode(repl.c_str()); #endif }