Question: I'm playing around with the locale and I18N stuff in c++ and have been looking for real world examples. I've read through the Josuttis chapter on I18N in his [book](http://www.josuttis.com/libbook/) (2nd Edition for C++11 to be released April 2012), and found it useful but with no real world examples to draw from I've no idea if I'm following best practices are committing beginner mistakes. What resources can StackOverflow point me towards both on the web and in print for doing I18N stuff in C++?

Also what libraries are available for C++ that makes i18n easier? What's not in the standard library that needs to be? At first glance, it seems that UTF8 support doesn't exist in the standard library.

Edit:

After doing some more reading, it seems that C and C++ are both Unicode "agnostic". It also seems that for dealing with data encoded in Unicode/UTF8/16/32 one needs to use a third party library. The crux of this is that the standard library itself only thinks about ISO 8859 and related character pages, which change based on what you're locale is set to. That means I probably want to use the ICU library for strings rather than using `std::string` or even `std::wstring`.

Answer: 
You've been pointed to [GNU gettext](http://www.gnu.org/software/gettext/), which allows you to replace literal strings with localized versions at run time - one aspect of localization (which is what happens after you've done the internationalization, when someone actually uses your internationalized code in a specific locale). You've also been pointed to the [Boost](http://www.boost.org/) (in particular [Boost.Locale](http://www.boost.org/doc/libs/1_61_0/libs/locale/doc/html/index.html)) libraries; that is usually a good answer for anything related to C++.

Another place you might look is the [ICU](http://www.icu-project.org/) (International Components for Unicode) project. And as a source of data, you might look at the [CLDR](http://unicode.org/cldr/) (Common Locale Data Repository) as a source of information about different locales; the Unicode web site also has lots of information about other aspects of different cultures because it deals with many languages.

And as a final resource for now, a rather specialized one, there is the [Olson Time Zone database](http://en.wikipedia.org/wiki/tz_database), which is updated multiple times each year to keep track of the way different countries change their rules on when to change between winter and summer (daylight saving and standard) time.
I second GNU gettext. However, if you're using Qt (and chances are good if you want to do GUI with C++), Qt comes with its own version of gettext and a fine translation tool (Qt Linguist) that makes things easier, and can also be used from non-GUI applications without overhead. We have it even in a service.

However, regarding what C++ lacks, just what comes to my mind:

* Full support for locales with regard to numbers, dates or currency. And remember that locales differ in more than just the decimal separator, including ordering, which brings me to the second point:
* C++ itself does not have a format function supporting ordered arguments (because in another language, the word order might be different than in your language). You can use boost::format for this. Qt of course supports it as well.

Also have a look at what you had to do for yourself, even if these things are supported. .NET for example comes with a comprehensive list of locales that are ready for use.