Esempio n. 1
0
std::string to_utf8(const std::u32string &s)
{
	std::wstring_convert<std::codecvt_utf8<int32_t>, int32_t> convert;
	auto p = reinterpret_cast<const int32_t *>(s.data());
	return convert.to_bytes(p, p + s.size());
}
Esempio n. 2
0
	std::string fromUTF32To8(const std::u32string &utf32String) {
		return UC32_CONVERTER.to_bytes(reinterpret_cast<const __int32*>(utf32String.data()));
	}
Esempio n. 3
0
	String String::fromUtf32(const std::u32string& utf32)
	{
		QString s = QString::fromUcs4((const uint*) utf32.data());
		std::u16string p{(const char16_t*) s.unicode(), size_t(s.size())};
		return String(p);
	}