1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
// codecvt::encoding example
#include <iostream> // std::cout
#include <locale> // std::locale, std::codecvt, std::use_facet
int main ()
{
std::locale loc;
const std::codecvt<wchar_t,char,mbstate_t>& myfacet =
std::use_facet<std::codecvt<wchar_t,char,mbstate_t> >(loc);
std::cout << "Characteristics of codecvt<wchar_t,char,mbstate_t>:\n";
std::cout << "Encoding: " << myfacet.encoding() << '\n';
std::cout << "Always noconv: " << myfacet.always_noconv() << '\n';
std::cout << "Max length: " << myfacet.max_length() << '\n';
return 0;
}
| |