在开发中遇见一个将文件流转换为Base64码,这个码中有特殊字符需要处理,然后选择用
HttpUtility.UrlEncode进行编码
HttpUtility.UrlEncode(text); //utf-8 编码 HttpUtility.UrlDecode(text); //utf-8 解码 HttpUtility.UrlEncode(text, System.Text.Encoding.GetEncoding(936)); //gb2312编码 HttpUtility.UrlDecode(text, System.Text.Encoding.GetEncoding(936)); //gb2312解码