UTF8--Unicode转换程序
来源:互联网 发布:淘宝怎么加入淘客 编辑:程序博客网 时间:2024/05/22 04:40
wchar_t * UTF8ToUnicode( const char* str )
{
int textlen ;
wchar_t * result;
textlen = MultiByteToWideChar( CP_UTF8, 0, str,-1, NULL,0 );
result = (wchar_t *)malloc((textlen+1)*sizeof(wchar_t));
memset(result,0,(textlen+1)*sizeof(wchar_t));
MultiByteToWideChar(CP_UTF8, 0,str,-1,(LPWSTR)result,textlen );
return result;
}
char * UnicodeToUTF8( const wchar_t* str )
{
char* result;
int textlen;
textlen = WideCharToMultiByte( CP_UTF8, 0, str, -1, NULL, 0, NULL, NULL );
result =(char *)malloc((textlen+1)*sizeof(char));
memset(result, 0, sizeof(char) * ( textlen + 1 ) );
WideCharToMultiByte( CP_UTF8, 0, str, -1, result, textlen, NULL, NULL );
return result;
{
int textlen ;
wchar_t * result;
textlen = MultiByteToWideChar( CP_UTF8, 0, str,-1, NULL,0 );
result = (wchar_t *)malloc((textlen+1)*sizeof(wchar_t));
memset(result,0,(textlen+1)*sizeof(wchar_t));
MultiByteToWideChar(CP_UTF8, 0,str,-1,(LPWSTR)result,textlen );
return result;
}
char * UnicodeToUTF8( const wchar_t* str )
{
char* result;
int textlen;
textlen = WideCharToMultiByte( CP_UTF8, 0, str, -1, NULL, 0, NULL, NULL );
result =(char *)malloc((textlen+1)*sizeof(char));
memset(result, 0, sizeof(char) * ( textlen + 1 ) );
WideCharToMultiByte( CP_UTF8, 0, str, -1, result, textlen, NULL, NULL );
return result;
}
希望能为需要的朋友解决问题,
如果还不能解决可以联系QQ897703027,email: hongjiandao@163.com
欢迎大家交流cocos2d-x,C++等各方面的知识,或者创业团队求收留,本人目前在做cocos2dx 网游
- UTF8--Unicode转换程序
- Unicode UTF8 转换等
- utf8与unicode转换
- ANSI Unicode,UTF8 转换
- ANSI - Unicode - UTF8 转换
- utf8与unicode转换
- Unicode UTF8 转换等
- utf8,unicode ,ansi转换
- unicode utf8 转换
- unicode,utf8,ansi转换
- utf8与unicode转换
- python unicode,utf8转换
- UTF8编码转换成Unicode
- unicode utf8 多字节转换
- UTF8, ASCII, UNICODE相互转换
- Ascii utf8 Unicode 字符串转换
- ANSI、UTF8、UNICODE 相互转换
- 字符编码转换(utf8-unicode)
- 清除tomcat缓存
- ORA-32004:obsolete and/or deprecated parameter
- VC List Control 用法及技巧 总结1
- 《c和指针》笔记--表达式作为左值或右值
- ORA-3113错误就是说连接到数据库的网络中断了。
- UTF8--Unicode转换程序
- 后缀树与后缀数组
- iptables学习(针对filter链)
- EXP-00091 Exporting questionable statistics
- Silverlight 操作Excel 中的进程资源释放问题
- C++ 中string.find() 函数的用法总结
- HP-UX 11.31 安装RAC 添加共享磁盘的问题(两种办法)
- 解决JSP乱码问题
- 11GR2新特性(转)