...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
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:
en_US.UTF-8
char
based strings, for example "UTF-8"For example:
cout << "The language code is " << std::use_facet<boost::locale::info>(some_locale).language() << endl;