Esempio n. 1
0
string const to_iconv_encoding(docstring const & s, string const & encoding)
{
	std::vector<char> const encoded =
		ucs4_to_eightbit(s.data(), s.length(), encoding);
	return string(encoded.begin(), encoded.end());
}
Esempio n. 2
0
string const to_utf8(docstring const & ucs4)
{
	vector<char> const utf8 = ucs4_to_utf8(ucs4.data(), ucs4.size());
	return string(utf8.begin(), utf8.end());
}