问题:
I am not able to understand the differences between std::string
and std::wstring
. 我无法理解std::string
和std::wstring
之间的区别。 I know wstring
supports wide characters such as Unicode characters. 我知道wstring
支持宽字符,例如Unicode字符。 I have got the following questions: 我有以下问题:
- When should I use
std::wstring
overstd::string
? 什么时候应该在std::string
使用std::wstring
? - Can
std::string
hold the entire ASCII character set, including the special characters?std::string
容纳整个ASCII字符集,包括特殊字符吗? - Is
std::wstring
supported by all popular C++ compilers? 所有流行的C ++编译器都支持std::wstring
吗? - What is exactly a " wide character "? 什么是“ 宽字符 ”?
解决方案:
参考一: https://stackoom.com/question/1geR/std-wstring-VS-std-string参考二: https://oldbug.net/q/1geR/std-wstring-VS-std-string
来源:oschina
链接:https://my.oschina.net/u/4428122/blog/4334824