UTF-8 Strings



Hi,

I need some advice. I have been reading several message threads from the
middle of last year bewteen Havoc Pennington and Nathan Myers about a
possible utf8-string class and was wondering what the end result of that
discussion was? 

Is it reasonable to write such a class and use it in a C++ Gtk library
or is it better leave UTF-8 conversions up to the user. Could you use
glib's gunichar and UTF-8 functions declared in gunicode.h in such a
class or would wchar_t be better.

I'm in the middle of writing such a class and have used many of the tips
from last years messages. What I've written is really just ended up a
re-write of  std::string using the data types and functions from
gunicode.h and a const_iterator. To the user the fact that its a UTF-8
string class is transparent because it looks and feels like a
std::string. But now I wonder if such a string class wont be too slow
and not worth the effort?

Jeff.




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