UTF-8 to local with #uXXXX escapes



Hello,
I can convert UTF-8 to local using a question mark for unknown
characters with a function like this:

std::string conv (const std::string& str)
{
	const std::string& to = "";
	const std::string& from = "UTF-8";
	const Glib::ustring& fallback = "?";
	
	return Glib::convert_with_fallback (str, to, from, fallback);
}

Now, I would like output like #u01a8 for Unicode characters.
How could one accomplish this? Wouldn't there be need for such
a conversion function?


ralf




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]