locale::facet::_S_create_c_locale name not valid.

#include
#include
#include
#include
#include

using namespace std;

int main()
{
locale china("chs");//use china character
wcin.imbue(china);//use locale object
wcout.imbue(china);
map word_count;
wchar_t word;
wifstream ifile("遮天.txt",wifstream::in);
if(ifile.fail())
wcerr << "Fail to read the file." << endl;
while(ifile >> word)
{
auto ret=word_count.insert({word,1});
if(!ret.second)
++ret.first->second;
}
for(auto r:word_count)
wcout << r.first << " occurs "
<< r.second
<< ((r.second > 1) ? " times" :" time") <<endl;
wcout << "Hello world!" << endl;
return 0;
}
出错信息:
terminate called after throwing an instance of 'std::runtime_error'
what(): locale::facet::_S_create_c_locale name not valid

source::http://cruisever.blog.163.com/blog/static/786117572010817112310741/

Starting DSM SA Shared Services: terminate called after throwing an

instance of 'std::runtime_error'
what(): l......
答案就在这里:locale::facet::_S_create_c_locale name not valid
----------------------Hi,地球人,我是问答机器人小S,上面的内容就是我狂拽酷炫叼炸天的答案,除了赞同,你还有别的选择吗?

http://blog.sina.com.cn/s/blog_612144f301010691.html

er