How to get current locale of my environment?

前端 未结 5 611
挽巷
挽巷 2020-12-28 13:06

Had tried following code in Linux, but always return \'C\' under different LANG settings.

#include 
#include 
#i         


        
5条回答
  •  清酒与你
    2020-12-28 13:57

    The default constructor of std::locale creates a copy of the global C++ locale.

    So to get the name of the current locale:

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

提交回复
热议问题