当前位置: 代码迷 >> VC/MFC >> MFC 对中文字符串UrlEncode用以 发送socket模拟http请求 无法识别字符串
  详细解决方案

MFC 对中文字符串UrlEncode用以 发送socket模拟http请求 无法识别字符串

热度:72   发布时间:2016-05-02 03:23:00.0
MFC 对中文字符串UrlEncode用于 发送socket模拟http请求 无法识别字符串
我参考了。
http://bbs.csdn.net/topics/230084699

关键代码:

CString text("【你好,我好。】");
wchar_t unicode[2000]={0};
MultiByteToWideChar(CP_ACP,0,text,strlen(text),unicode,1999);

unsigned char sz[2000]={0};
WideCharToMultiByte(CP_UTF8,0,unicode,wcslen(unicode),(LPSTR)sz,1999,0,0);


部分中文转换时没有问题的。但是字符串中包含特殊字符,就有问题了。
------解决思路----------------------
中文需要转为Base64格式提交
  相关解决方案