在开发中遇见一个将文件流转换为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解码
View Code

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2021-08-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-17
  • 2022-12-23
  • 2021-08-20
  • 2022-12-23
  • 2022-12-23
  • 2021-07-29
相关资源
相似解决方案