用于Boost的不同unicode脚本的POSIX语言环境

时间:2013-11-12 11:21:42

标签: c++ boost unicode setlocale

我正在使用Boost Ofstream进行Unicode std :: string输出。我坚持使用正确的语言环境(Boost)/ Encoding来支持所有语言(在所有Unicode版本中达到6.3)。该代码的目标是在VS2010和GCC 4.8上进行编译

loc::generator gen;
std::locale _loc= gen.generate("en_US.utf-8"); // use the right POSIX locale/ encoding, 
                                              // to support different versions of Unicode 
                                             // and with different compilers
std::string str = "my unicode string";
boost::filesystem::ofstream _file("my file.txt");
_file.imbue(_loc);
_file<<str;

我试图了解不同编译器的不同Unicode版本,编码,语言环境支持。

0 个答案:

没有答案