url编码
[ 2007-04-13 15:45:10 | 作者: admin ]
google:
Encoding enc = Encoding.GetEncoding("UTF-8");
Response.Write( System.Web.HttpUtility.UrlDecode("%E8%B0%B7%E6%AD%8C",enc));
结果为“谷歌”
baidu:
Encoding enc = Encoding.GetEncoding("gb2312");
Response.Write( System.Web.HttpUtility.UrlDecode("%D7%AA%BB%BB",enc));
结果为“转换”
编码的时候:
Response.Write(System.Web.HttpUtility.UrlEncode("百度", Encoding.Default ));
Response.Write(System.Web.HttpUtility.UrlEncode("百度",System.Text.Encoding.GetEncoding("gb2312")));
评论Feed: http://blog.xg98.com/feed.asp?q=comment&id=853
Encoding enc = Encoding.GetEncoding("UTF-8");
Response.Write( System.Web.HttpUtility.UrlDecode("%E8%B0%B7%E6%AD%8C",enc));
结果为“谷歌”
baidu:
Encoding enc = Encoding.GetEncoding("gb2312");
Response.Write( System.Web.HttpUtility.UrlDecode("%D7%AA%BB%BB",enc));
结果为“转换”
编码的时候:
Response.Write(System.Web.HttpUtility.UrlEncode("百度", Encoding.Default ));
Response.Write(System.Web.HttpUtility.UrlEncode("百度",System.Text.Encoding.GetEncoding("gb2312")));
[最后修改由 admin, 于 2007-04-13 15:49:26]

这篇日志没有评论。
此日志不可发表评论。