|
|
Subscribe / Log in / New account

GNOME v. KDE, December 2005 edition

GNOME v. KDE, December 2005 edition

Posted Dec 13, 2005 23:28 UTC (Tue) by nix (subscriber, #2304)
In reply to: GNOME v. KDE, December 2005 edition by halla
Parent article: GNOME v. KDE, December 2005 edition

Of course C++ standard string class still isn't suitable for real-world use
This turns out not to be the case.


to post comments

GNOME v. KDE, December 2005 edition

Posted Dec 14, 2005 9:28 UTC (Wed) by cloose (guest, #5066) [Link] (4 responses)

Oh, yeah. The Unicode support is so great in std::string, right??

GNOME v. KDE, December 2005 edition

Posted Dec 14, 2005 20:19 UTC (Wed) by nix (subscriber, #2304) [Link] (3 responses)

std::string does not dictate representation. That's what traits classes are for. Traits classes for UTF-8, UCS-16, and so on would not be very difficult to write.

This has been true for longer than Qt has existed, I believe: certainly it was true for years before the standardization process was complete.

GNOME v. KDE, December 2005 edition

Posted Dec 14, 2005 21:32 UTC (Wed) by cloose (guest, #5066) [Link] (2 responses)

std::string does not dictate representation. That's what traits classes are for. Traits classes for UTF-8, UCS-16, and so on would not be very difficult to write.

No, you also need codecvt<> facets to convert between different representations (UCS-4, UTF-8, etc). And that's were it gets ugly.

AFAIK even "the C++ standard loving" gtkmm created there own string class for UTF-8 (see Glib::ustring).

So I would say a) it's not as easy as you make sound and b) as a app developer i have better things to do and just use QString. ;)

GNOME v. KDE, December 2005 edition

Posted Dec 15, 2005 10:04 UTC (Thu) by nix (subscriber, #2304) [Link] (1 responses)

<blockquote>
No, you also need codecvt<> facets to convert between different representations (UCS-4, UTF-8, etc). And that's were it gets ugly.
</blockquote>
Actually it's about ten lines of calling iconv. I've done it. It's not hard.

GNOME v. KDE, December 2005 edition

Posted Dec 22, 2005 8:20 UTC (Thu) by oever (guest, #987) [Link]

Actually it's about ten lines of calling iconv. I've done it. It's not hard.

That sounds interesting. I've been looking for a way to handle different encodings nicely with just the STL. Could you give me a pointer to an example?

GNOME v. KDE, December 2005 edition

Posted Dec 26, 2005 23:54 UTC (Mon) by Baylink (guest, #755) [Link]

Is that the same as "bullshit"?

:-)


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds