views:

57

answers:

2

Hello,

I'm writing a C++ application which shall be locale independent, so I decided to use UTF-16 as my in-memory representation for strings/texts (the application should be as platform independent as possible). For localize the application's messages i want to use GNU's gettext library. Since this library seems to use GNU's libunistring library internally, i want to use this one too.

Is this a good solution for i18n, l10n? I mean it will be a lot of C code in my C++ classes (I don't found a C++ Wrapper for the libunistring library).

Stefan

PS: It's my first big C++ application.

+1  A: 

Use UTF8 instead. see :

Klaim
The libunistring library also supports UTF-8 as in-memory representation, so it's no problem to use it. Do you know a better library for doing this? The libunistring one seems to be not not so good documented.
Stefan
@Downvoter: Using UTF-16 in C++ code could be problematic, especially if one needs to convert between UTF-16 and UTF-8. I don't see valid reason for downvoting this answer.
Paweł Dyda
A: 

If it is a gui application written in c++, qt might be a good toolkit to do it in. It includes its own string class and its own internationalization support:

http://doc.trolltech.com/4.7/internationalization.html.

Also you can use the core non gui classes by themselves(they are in their own QtCore namespace separate form the QtGui namespace, and there are compiled to separate dynamically linked libraries).

Roman A. Taycher