FreeBSD Manual Pages
std::locale::name(3) C++ Standard Libary std::locale::name(3) NAME std::locale::name - std::locale::name Synopsis Defined in header <locale> std::string name() const; Returns the name of the locale, which is the name by which it is known to the operating system, such as "POSIX" or "en_US.UTF8" or "English_United States.1252". If the locale is not a copy of a system-supplied locale, the string "*" is returned. Return value The name of the locale or "*" if unnamed. Example // Run this code #include <locale> #include <iostream> #include <string> int main() { std::locale loc(std::locale(), new std::ctype<char>); std::cout << "The default locale is " << std::locale().name() << '\n' << "The user's locale is " << std::locale("").name() << '\n' << "A nameless locale is " << loc.name() << '\n'; } Output: The default locale is C The user's locale is en_US.UTF8 A nameless locale is * See also constructor constructs a new locale (public member function) http://cppreference.com 2022.07.31 std::locale::name(3)
NAME | Synopsis | Return value | Example | Output: | See also
Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=std::locale::name&sektion=3&manpath=FreeBSD+Ports+15.0>
