Mar*_*ork 22 c++ locale utf-16
如何找到有效的区域设置名称?
我目前正在使用MAC OS X.
但是有关其他平台的信息也很有用.
#include <fstream>
#include <iostream>
int main(int argc,char* argv[])
{
try
{
std::wifstream data;
data.imbue(std::locale("en_US.UTF-16"));
data.open("Plop");
}
catch(std::exception const& e)
{
std::cout << "Exception: " << e.what() << "\n";
throw;
}
}
% g++ main.cpp
% ./a.out
Exception: locale::facet::_S_create_c_locale name not valid
Abort
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
14187 次 |
| 最近记录: |