.net c# GBK编码
对接的时候可能会查询 .Replace("%3d", "%3D") 不区分大小写清空
2014年08月11日 11:27:43 goodyatou 阅读数 7614
//地址编码 gbk
public static string UrlEncode(string dataStr)
{
return HttpUtility.UrlEncode(dataStr, Encoding.GetEncoding("gbk"));
}
//地址解码 gbk
public static string UrlDecode(string dataStr)
{
return HttpUtility.UrlDecode(dataStr, Encoding.GetEncoding("gbk"));
}
本文介绍了一个在C#中使用GBK编码进行URL编码和解码的方法,通过自定义函数UrlEncode和UrlDecode,实现了对数据字符串的编码和解码,确保了在不同系统间传递数据的一致性和正确性。
1891

被折叠的 条评论
为什么被折叠?



