多字节和宽字节的互相转换函数
来源:互联网 发布:开元盛世 知乎 编辑:程序博客网 时间:2024/05/22 23:58
string UnicodeToWideChar(const wstring &str)
{
int nLen = WideCharToMultiByte(CP_ACP,0,str.c_str(),-1,NULL,0,NULL,NULL);
char *pStr = new char[nLen];
memset(pStr,0,sizeof(char)*nLen);
WideCharToMultiByte(CP_ACP,0,str.c_str(),-1,pStr,nLen,NULL,NULL);
string strText = pStr;
delete[] pStr;
pStr = NULL;
return strText;
}
wstring WideCharToUnicode(const string &str)
{
int nLen = MultiByteToWideChar(CP_ACP,0,str.c_str(),-1,NULL,0);
wchar_t *pStr = new wchar_t[nLen];
memset(pStr,0,sizeof(wchar_t)*nLen);
MultiByteToWideChar(CP_ACP,0,str.c_str(),-1,pStr,nLen);
wstring strText = pStr;
delete[] pStr;
pStr = NULL;
return strText;
}
0 0
- 多字节和宽字节的互相转换函数
- 多字节和宽字节互相转换的方便方法
- 标准C中多字节和宽字节的互相转换
- 宽字节与多字节转换函数
- VC 宽字节和多字节的相互转换
- 关于宽字节和多字节之间的转换
- VC 宽字节和多字节的相互转换
- 多字符 宽字符的互相转换函数
- 关于windows多字节和宽字节函数的总结:
- linux下宽字节和多字符之间的转换
- VC多字节字符串和宽字节字符串转换
- Visual Studio中宽字节和多字节相互转换
- A2W和W2A :很好的多字节和宽字节字符串的转换宏
- A2W和W2A :很好的多字节和宽字节字符串的转换宏
- A2W和W2A :很好的多字节和宽字节字符串的转换宏
- A2W和W2A :很好的多字节和宽字节字符串的转换宏
- Windows 的多字节与宽字节的转换
- 多字节与宽字节相互转换的方法
- Hibernate的继承映射
- Enterprise Test Driven Develop
- 防止程序重复打开
- function overload
- FFmpeg Android 移植,改 main 函数JNI调用
- 多字节和宽字节的互相转换函数
- requestDisallowInterceptTouchEvent
- MVC设计模式的总结
- subprocess source code learning - posix - 1
- 编程2.2
- Uva 208 - Firetruck
- 中文和unicode字符的相互转换
- 写给即将毕业的自己
- 《JavaScript DOM编程艺术》知识整理