Toubles handling ustring and charsets.



Hi I'm using Glib::ustring as a string container to handle utf8 but I'm having some troubles. When I try to print a ustring with utf8 chars like "í "or  "ñ" to stdout i always get this exception(with ascii chars it works well):
       terminate called after throwing an instance of 'Glib::ConvertError'
with this error:
       Invalid byte sequence in conversion input

When i call Glib::get_charset(charset) the function always returns ANSI_X3.4-1968 as the charset may be this is the reason that conversion fails even when I use Glib::locale_from_utf8()??

I have tried with different charsets ( ISO-8859-15 and UTF8) specified with locale (locale charmap to get the charset which is being used) but
Glib::get_charset(charset) always returns ANSI_X3.4-196 as charset and i can't print it even using Glib::locale_from_utf8()  function.
Any clue to solve this.

Thanks.


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