【发布时间】:2011-03-17 15:52:54
【问题描述】:
我正在使用一个包装 std::wstring 的类,此代码需要跨平台,是否有 Windows 函数的等价物:Linux 上的 MultiByteToWideChar 和 WideCharToMultiByte?
谢谢。
【问题讨论】:
-
请记住,在 GNU/Linux 上,std::wstring 是 Windows 上 std::wstring 大小的两倍。
-
这里有 C99 函数 mbtowc 和 wctomb
-
@Johannes Schaub:
mbtowc和wctomb实际上是在 1995 年的规范性修正案 1 中添加的。
标签: c++ windows linux unicode stdstring