如何URL编码和UTF-8编码 还有BASE64编码...给跪啦..新手 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 base 64 : #include <atlenc.h>utf-8: WideCharToMultiByte(CP_UTF8, ...)url的因为是公司代码,不方便贴 开源的有很多啊,搜一下 url encode csdn下载频道都有现成的代码,去下载并集成到软件中就行了。 //**************************************// unicode字符串转utf8字符串// 返回大于0成功,小于0失败//**************************************intustr_u8str( WCHAR *unicodestr, char *utf8str ){ int result = 0; try { int needlen = WideCharToMultiByte( CP_UTF8, 0, unicodestr, -1, NULL, 0, NULL, NULL ); if( needlen < 0 ) { return needlen; } result = WideCharToMultiByte( CP_UTF8, 0, unicodestr, -1, utf8str, needlen + 1, NULL, NULL ); if( result < 0 ) { return result; } return ( result - 1 ); } catch( ... ) { ShowError(); } return result;} ActiveX控件中get()/set()与memeber varial方式 问题 求助啊!关于加载动态库内存泄露 关于函数WSAStartup? 调用noop 就会使得UI锁死 这是为什么呢 请问如何播放RTSP协议的TS流?? mfc多文档中文档指针传递问题 求PCI9054 S/G DMA传输方式的例程 请教MediaPlayer方面的问题。 200分,RGB565格式如何表示256级的灰度的转换关系?在线等待 定位为界面开发 有前途吗? 窗口关闭问题 CButton::Create函数UINT nID什么作用?
utf-8: WideCharToMultiByte(CP_UTF8, ...)
url的因为是公司代码,不方便贴
// unicode字符串转utf8字符串
// 返回大于0成功,小于0失败
//**************************************
int
ustr_u8str( WCHAR *unicodestr, char *utf8str )
{
int result = 0;
try
{
int needlen = WideCharToMultiByte( CP_UTF8, 0, unicodestr, -1, NULL, 0, NULL, NULL );
if( needlen < 0 )
{
return needlen;
} result = WideCharToMultiByte( CP_UTF8, 0, unicodestr, -1, utf8str, needlen + 1, NULL, NULL );
if( result < 0 )
{
return result;
}
return ( result - 1 );
}
catch( ... )
{
ShowError();
}
return result;
}