This namespace provides various utility function useful for Boost.Locale backends implementations. More...
This namespace provides various utility function useful for Boost.Locale backends implementations.
Install codecvt facet into locale in and return new locale that is based on in and uses new facet.
codecvt facet would convert between narrow and wide/char16_t/char32_t encodings using cvt converter. If cvt is null pointer, always failure conversion would be used that fails on every first input or output.
Note: the codecvt facet handles both UTF-16 and UTF-32 wide encodings, it knows to break and join Unicode code-points above 0xFFFF to and from surrogate pairs correctly. cvt should be unaware of wide encoding type
Installs information facet to locale in based on locale name name.
This function installs boost::locale::info facet into the locale in and returns newly created locale.
Note: all information is based only on parsing of string name;
The name has following format: language[_COUNTRY][.encoding][@variant] Where language is ISO-639 language code like "en" or "ru", COUNTRY is ISO-3166 country identifier like "US" or "RU". the Encoding is a charracter set name like UTF-8 or ISO-8859-1. Variant is backend specific variant like
euro or calendar=hebrew.
If some parameters are missing they are specified as blanks, default encoding is assumed to be US-ASCII and missing language is assumed to be "C"
This function creates a base_converter that can be used for conversion between single byte character encodings like ISO-8859-1, koi8-r, windows-1255 and Unicode code points,
If encoding is not supported, empty pointer is returned. You should check if std::auto_ptr<base_converter>::get() != 0
This function creates a base_converter that can be used for conversion between UTF-8 and unicode code points
Return default system locale name in POSIX format.
This function tries to detect the locale using, LC_CTYPE, LC_ALL and LANG environment variables in this order and if all of them unset, in POSIX platforms it returns "C"
On Windows additionally to check the above environment variables, this function tries to creates locale name from ISO-339 and ISO-3199 country codes defined for user default locale. If use_utf8_on_windows is true it sets the encoding to UTF-8, otherwise, if system locale supports ANSI code-page it defines the ANSI encoding like windows-1252, otherwise it fall-backs to UTF-8 encoding if ANSI code-page is not available.