我欲乘风yecheng.blog.chinaunix.net
yecheng_110
全部博文(78)
2007年(53)
2006年(25)
DT27
jolinok
ylke2007
saintdra
zhxd
大鬼不动
tntcheng
chenkeac
flb_2001
yyfq521
bluesky0
zjq5688
w1818618
168Kill
myoeoo
bolebdms
sxzf168
11qq22ww
分类:
2006-11-02 18:51:39
std::string ConnectionHandler::miniURLEncode(std::string s)
{ std::string encoded; char* buf = new char[16]; // way longer than needed unsigned char c; for(int i=0; i < (signed)s.length(); i++)
{ c = s[i]; if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') ||
c == '.' || c == '-' || c == '_')
{
// allowed characters in a url that have non special meaning encoded += c; continue; } if(c == ' ') { encoded += '+'; continue; } sprintf(buf, "%x", c); encoded += "%"; encoded += buf; } delete[] buf; return encoded; }
上一篇:后台执行CGI的问题[perl]
下一篇:MessageBox的用法
登录 注册