C++ 如何转换ReadDirectoryChangesW的unicode版本
我需要将ReadDirectoryChangesW的Unicode版本转换为支持多字节是可能的您可以使用此简单方法将多字节字符串转换为Unicode字符串C++ 如何转换ReadDirectoryChangesW的unicode版本,c++,visual-c++,C++,Visual C++,我需要将ReadDirectoryChangesW的Unicode版本转换为支持多字节是可能的您可以使用此简单方法将多字节字符串转换为Unicode字符串 #include <string> #include <sstream> template <typename inputtype> std::wstring toUTF16String(const inputtype& input) {
#include <string>
#include <sstream>
template <typename inputtype>
std::wstring toUTF16String(const inputtype& input)
{
std::wstringstream ss;
ss << input;
return ss.str();
}
#包括
#包括
样板
std::wstring toUTF16String(常量输入类型和输入)
{
std::wstringstream ss;
ss您的意思是“将文件\通知\信息::文件名成员从Unicode转换为多字节”吗?请使用前面问题的答案,这里是:警告:(假设inputtype为std::string或const char*):这将使用加宽()单独转换每个字符全局语言环境的char_方法具有方面特征,因此不适合任何多字节编码。