上C++ and UTF8 - Why not just replace ASCII?ustring - std :: string/std :: wstring的就地替換?
的延續爲什麼沒有std::ustring
可以代替兩個std::string
,std::wstring
在新的應用?
當然在標準庫中有相應的支持。類似於boost::filesystem3::path
不關心字符串表示並與std::string
和std::wstring
一起使用。
上C++ and UTF8 - Why not just replace ASCII?ustring - std :: string/std :: wstring的就地替換?
的延續爲什麼沒有std::ustring
可以代替兩個std::string
,std::wstring
在新的應用?
當然在標準庫中有相應的支持。類似於boost::filesystem3::path
不關心字符串表示並與std::string
和std::wstring
一起使用。
有std::u16string
和std::u32string
。您可能希望使用這些標準庫的標準庫命名一個用fstream打開的文件,將不會被改爲使用這些文件,因爲它們實際上不能。例如,某些平臺採用幾乎任意的字節字符串來命名要打開的文件,但沒有指定的編碼。不得不通過具有特定編碼的字符串運行它會破壞事物並且不兼容。
這些僅在'C++ 11' /'C++ 0x'中可用,並非所有編譯器或操作系統都完全支持。 – waddlesplash