Re: std::cout << Glib::ustring(utf8_literal) throws exception



Murray Cumming wrote:
On Sat, 2008-07-12 at 19:15 -0700, Sohail Somani wrote:
Yes, you are right. Copying the ustring to a std::string gets rid of the error but still doesn't work right because it is interpreted as ASCII in the console.

std::cout does not understand UTF-8. That's why glibmm tries to do a
conversion (with the Glib::convert_*() functions. That's documented by
the way:
http://www.gtkmm.org/docs/glibmm-2.4/docs/reference/html/classGlib_1_1ustring.html#_details

But I don't know why the conversion is failing in your case. Maybe it's
a problem with the glib installation on windows.

Isn't the whole point of UTF-8 that std::cout doesn't need to understand it?

Shouldn't it be the console (or whatever is reading the output) who tries to understand it?

--
Sohail Somani
http://uint32t.blogspot.com



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