Boost.Locale
Getting information about the current locale

The std::locale::name function provides very limited information about a locale. Such a name is platform- and compiler-dependent, and is useless for Boost.Locale. There is no way to change it, so for all locales created by Boost.Locale, name() returns the same value as name() for std::locale::classic().

Thus an additional facet was created, giving more precise information: boost::locale::info. It has the following member functions:

For example:

cout << "The language code is " << std::use_facet<boost::locale::info>(some_locale).language() << endl;