C#特殊字符快速转码

             encodeURIComponent('\n')
             "%0A"
             encodeURIComponent('\\')
             "%5C"
             encodeURIComponent('/')
             "%2F" 

          encodeURIComponent(',')
          "%2C"

          encodeURIComponent('\'')

          %27

        encodeURIComponent("\"")
        "%22"

     data = json;
     data = data.Replace("\\", "%5C").Replace("\n", "%0A");//.Replace("/","%2F");
.Replace(",", "%2C").Replace("'", "%27").Replace("\\", "%5C").Replace("\n", "%0A")

 


        encodeURIComponent("\"")
        "%22"
        encodeURIComponent('\\')
             "%5C"
最终
posted @ 2020-09-03 17:43  enych  阅读(994)  评论(0编辑  收藏  举报