How to get the LCID from std::locale

980 views Asked by At

In windows how to get the LCID from the std::locale

locale l1(".OCP");//get the default system locale
cout<<l1.c_str()<<endl;

In previous code i get the name of the locale but the win32 LCID this is the required one

1

There are 1 answers

2
Dietmar Kühl On

The only identifying entity associated with a std::locale() is its `name():

std::cout << l1.name() << '\n';

The content of this attribute is rather weakly specified but in the above setup it should have a name and yield something different from "*" which is what is returned for unnamed locales. What the name is, isn't specified, however.