[gtkmm] Glib::ustring problems



Having some problems with Glib::ustring in gtkmm2...

It seems I cannot print some strings until I run the function .c_str()
on them when working in a locale with charset = UTF-8.  The following
code works (in each case t is initialized from a string constant).

cout << t.c_str() << endl;

as does this:

cout << t.c_str() << endl
cout << t << endl;

but the following by itself doesn't

cout << t << endl;

I get the following error:
(hisaab:24296): glibmm-CRITICAL **: 
unhandled exception (type Glib::Error) in signal handler:
domain: g_convert_error
code  : 1
what  : ¿¢¨à áü¢Ã¢ý ¯ûãÃ
                                     ø ºÃ¢Ãü ¨Ãð Ã⨺èÃ

This error doesnt happen in en_US locale which uses iso-8859-1 charset. 
Any ideas what is happening here?

Also, what is preferred to assign one ustring to another, operator= or
the assign function or are they equivalent?

Thanks for your help!  (btw is the gtk-devel list better for these types
of queries?)

-- Tapan



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