cpp/locale/setlocale

The function installs the specified system locale or its portion as the new C locale. The modifications remain in effect and influences the execution of all locale-sensitive C library functions until the next call to. If is a null pointer,  queries the current C locale without modifying it.

Return value
Pointer to a narrow null-terminated string identifying the C locale after applying the changes, if any, or null pointer on failure.

A copy of the returned string along with the category used in this call to may be used later in the program to restore the locale back to the state at the end of this call.