Re: std::wstring to glib::ustring conversion
- From: Milosz Derezynski <internalerror gmail com>
- To: 陈凯 <chenkai036 gmail com>
- Cc: gtkmm-list gnome org
- Subject: Re: std::wstring to glib::ustring conversion
- Date: Tue, 28 Apr 2009 12:49:48 +0200
It's not really about the data type used, but about the encoding of the original string.
For one, there is
http://www.unicode.org/Public/PROGRAMS/CVTUTF/, which is of course not part of glib, but is probably a good way to do it.
Then, you can use
http://gtkmm.org/docs/glibmm-2.4/docs/reference/html/group__CharsetConv.html#g58f7e4556c436a96c64b186bbc8f7f4c , for converting between UTF-16 (which is what I assume your wstrings are), and UTF-8.
Then finally you can place the result into a Glib::ustring.
Hope this helps,
M.
On Tue, Apr 28, 2009 at 12:39 PM, 陈凯
<chenkai036 gmail com> wrote:
Greetings,
Recently I plan to port my app from Windows to linux using Gtkmm library. I found glib::ustring is recommended to use, but my app works with std::wstring. However, there seems no sign of documentations about the conversion from std::wstring to glib::string in the gtkmm library. I got stuck here. Could some one help me out of the question? Thanks in advance :)
Regards
CHEN Kai
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list
--
Please note that according to the German law on data retention,
information on every electronic information exchange with me is
retained for a period of six months.
[Bitte beachten Sie, dass dem Gesetz zur Vorratsdatenspeicherung zufolge
jeder elektronische Kontakt mit mir sechs Monate lang gespeichert wird.]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]