explicit ctype_byname(const char*, size_t refs = 0);
The facet ctype has several responsibilities:
The first two of these items can be customized with ctype_byname. If you construct ctype_byname with a const char* that refers to a file, then that file is scanned by ctype_byname's constructor for information to customize character classification, and case transformation tables.
ctype_byname<char> ct("en_US");
// looks for the file "en_US"
If the file "en_US" exists, has ctype data in it, and there are no syntax errors in the data, then ct will behave as dictated by that data. If the file exists, but does not have ctype data in it, then the facet will behave as if it were constructed with "C". If the file has ctype data in it, but there is a syntax error in the data, or if the file does not exist, then a std::runtime_error is thrown.
For ctype_byname<char>, the ctype data section begins with:
$ctype_narrow
For ctype_byname<wchar_t>, the ctype data section begins with:
$ctype_wide