LPWSTR 显示乱码
程序代码:
void parseDriverInfo(DRIVER_INFO_2W *pdinfo, v8::Handle<v8::Object> result_pdinfo) { MY_NODE_MODULE_ISOLATE_DECL #define ADD_V8_STRING_PROPERTY(name, key) if((pdinfo->##key != NULL) && (*pdinfo->##key != L'\0')) \ { \ result_pdinfo->Set(V8_STRING_NEW_UTF8(#name), V8_STRING_NEW_2BYTES((uint16_t*)pdinfo->##key)); \ } ADD_V8_STRING_PROPERTY(configFile, pConfigFile); #undef ADD_V8_STRING_PROPERTY result_pdinfo->Set(V8_STRING_NEW_UTF8("namex"), V8_STRING_NEW_2BYTES((uint16_t*)pdinfo->pName)); \\只要包含中文就会是乱码,部分英文能正常显示 }