On Saturday 03 June 2006 12:19 am, Vinzenz 'evilissimo' Feenstra wrote:
> Hi,
>
> I'm trying to use a string with german umlauts in an application and
> Glib::locale_to_utf8 returns an invalid string.
> If I execute this:
>
> Glib::ustring test = Glib::locale_to_utf8("äöüß");
>
> and I retrieve an invalid object Glib::ustring the debugger shows me an
> Bad Pointer in this object.
>
> I'm wondering if this _can_ be a Glibmm problem or if it is more a Glib
> problem?
>
> Btw anyone knows another GTK+ package like this one from gladewin32.sf.net?
It is very bad practice to call Glib::locale_to_utf8() on a string literal
because it will only work if the codeset locale on the machine on which the
code is compiled is the same as the codeset in which the string literal
happens to have been written. These may not even be the same if the code is
written and compiled on the same machine (it will depend on the editor with
which the code is being written).
If you want a string literal to be in UTF8 then write it in UTF8, or write it
in some other known codeset and use codeset conversion which does not base
itself on the locale.
Chris.
_______________________________________________
gtkmm-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtkmm-list