C++ reset locale to “C” globally?

岁酱吖の 提交于 2019-12-05 01:48:53

I believe std::locale::global(std::locale("C")); should do the trick. See http://en.cppreference.com/w/cpp/locale/locale/global

Note that this only affects streams created after this call.

Any streams such as cout that the other library already imbued would have to be re-imbued back to the desired default locale.

And finally I would strongly suggest filing a defect report against the library you're using because it's pretty unjustifiable to to unilaterally make such striking global changes within your initialization function.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!