【发布时间】:2011-12-06 13:46:43
【问题描述】:
C++ and UTF8 - Why not just replace ASCII? 的延续
为什么没有std::ustring 可以在新应用程序中同时替换std::string、std::wstring?
当然在标准库中有相应的支持。与boost::filesystem3::path 不关心字符串表示并与std::string 和std::wstring 一起工作的方式类似。
【问题讨论】:
C++ and UTF8 - Why not just replace ASCII? 的延续
为什么没有std::ustring 可以在新应用程序中同时替换std::string、std::wstring?
当然在标准库中有相应的支持。与boost::filesystem3::path 不关心字符串表示并与std::string 和std::wstring 一起工作的方式类似。
【问题讨论】:
有std::u16string 和std::u32string。您可能想要使用这些的标准库,例如命名要使用 fstream 打开的文件,不会更改为使用这些,因为它们确实不能。例如,某些平台采用几乎任意字节字符串来命名要打开的文件,而没有指定编码。必须通过具有特定编码的字符串运行它会破坏事情并且不兼容。
【讨论】:
C++11/C++0x 中可用,并非所有编译器或操作系统都完全支持。