revive lost to_utf8 method but move it into '<mapnik/unicode.hpp>'

This commit is contained in:
artemp 2016-03-02 16:47:55 +01:00
parent 65da617ec0
commit f11cc5920f
2 changed files with 12 additions and 0 deletions

View file

@ -45,6 +45,10 @@ public:
private:
UConverter * conv_;
};
// convinience method
void to_utf8(mapnik::value_unicode_string const& input, std::string & target);
}
#endif // MAPNIK_UNICODE_HPP

View file

@ -60,4 +60,12 @@ transcoder::~transcoder()
{
if (conv_) ucnv_close(conv_);
}
void to_utf8(mapnik::value_unicode_string const& input, std::string & target)
{
target.clear(); // mimic previous target.assign(...) semantics
input.toUTF8String(target); // this appends to target
}
}