[gtkmm] converting iso-8859-1 to Glib::ustring



Hi everyone,

After reading through the tutorial and the glibmm docs, I'm still unsure how
to go about converting non-ascii strings to utf8.  Let's say I have
the following:

std::string iso("\xf1");  // iso-8859-1 encoding: n+tilde

How do I make this into a Glib::ustring?  

  Glib::locale_to_utf8(iso);

throws "Invalid byte sequence in conversion input", as does 

  Glib::convert(iso, "", "iso-8859-1");

How do I tell Glib to use a specific encoding when converting?

thanks,
--
joey yandle                             ___====-_  _-====___
www.divisionbyzero.com            _--~~~#####//      \\#####~~~--_
/jwy/pubkey.asc                _-~##########// (    ) \\##########~-_
                              -############//  :\^^/:  \\############-
                            _~############//   (@::@)   \\############~_
                           ~#############((     \\//     ))#############~
                          -###############\\    (^^)    //###############-
                         -#################\\  / "" \  //#################-
                        -###################\\/      \//###################-
                       _#/:##########/\######(   /\   )######/\##########:\#_
                       :/ :#/\#/\#/\/  \#/\##\  :  :  /##/\#/  \/\#/\#/\#: \:
                       "  :/  V  V  "   V  \#\: :  : :/#/  V   "  V  V  \:  "
                          "   "  "      "   \ : :  : : /   "      "  "   "




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