赞
踩
byte[] buf = Encoding.GetEncoding(936).GetBytes(str);
Encoding e1 = Encoding.UTF8;
Encoding e2 = Encoding.GetEncoding(936);
string word = System.Web.HttpUtility.UrlEncode(Encoding.Convert(e2, e1, buf)); //gb2312->utf8
C# code
string str = " CSDN的天地 " ; str = HttpUtility.UrlEncode(str, Encoding.UTF8);
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。