Re: [libxml++] Swap std::string for Glib::ustring
- From: Matthias Wimmer <m tthias eu>
- To: Sean Farrell <sean farrell rioki org>, libxmlplusplus-general lists sourceforge net
- Subject: Re: [libxml++] Swap std::string for Glib::ustring
- Date: Sun, 03 Aug 2008 12:19:29 +0200
Hi Sean!
Sean Farrell schrieb:
I see the initial motivation of using Glib::ustring, since the strings
handled are UTF-8. But if one looks at the code, Glub::ustring is just
used as a container for UTF-8 and no real operations are done.
This is not correct. One big difference between Glib::ustring and
std::ustring is the way lengths and positions in the string are handled.
If you ask a std::ustring for its length you get the number of bytes, if
you ask Glib::ustring you get the number of characters. Same if you
handle with substrings and that like.
This is very important if you have to truncate strings, with
std::ustring you always risk to split a UTF-8 character in its middle if
you do not take special care.
Matthias
[
Date Prev][Date Next] [
Thread Prev][Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]