Re: outputting non-ASCII string problem



On Fri, 2007-03-16 at 08:47 -0600, Gezim Hoxha wrote:
> On Thu, 2007-15-03 at 05:12 -0500, Robert Caryl wrote:
> > In place of 
> > 
> > std::cout << line << std::endl;
> > 
> > try
> > 
> > std::cout << line.c_str() << std::endl;
> 
> Thanks Bob. That works but I wonder why it's needed. What can std::cout
> print without choking? Or is std::cout choking to begin with? Is there
> another way to solve this?

When using Glib::ustring with std::cout, it tries to convert to your
locale, and that might not always be possible. You should probably
convert explicitly if you want to do this. There's more about this here:
http://www.gtkmm.org/docs/glibmm-2.4/docs/reference/html/classGlib_1_1ustring.html#_details

The problem is in std::cout, which doesn't do UTF-8, I think.

-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




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