0

我正在使用 Boost Ofstream 进行 Unicode std::string 输出。我坚持使用正确的语言环境(Boost)/编码来支持所有语言(在所有 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 版本、编码、语言环境支持。

4

0 回答 0