VC CString 转 UTF-8

[复制链接]
查看11 | 回复1 | 2010-6-13 16:47:46 | 显示全部楼层 |阅读模式
帮我写个函数实现 CString 转 UTF-8 谢谢

回复

使用道具 举报

千问 | 2010-6-13 16:47:46 | 显示全部楼层
//CP_ACP=ANSI,CP_UTF8=utf-8CString CMarcoPolo_PriceSysApp::UTF8Convert(CString &str,int sourceCodepage,int targetCodepage){int len=str.GetLength(); int unicodeLen=MultiByteToWideChar(sourceCodepage,0,str,-1,NULL,0); wchar_t * pUnicode; pUnicode=new wchar_t[unicodeLen+1]; memset(pUnicode,0,(unicodeLen+1)*sizeo
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行