Difference between Url Encode and HTML encode

前端 未结 5 1219
情书的邮戳
情书的邮戳 2021-01-18 06:52

What’s the difference between an URL Encode and a HTML Encode?

5条回答
  •  生来不讨喜
    2021-01-18 07:44

    HTML Encoding escapes special characters in strings used in HTML documents to prevent confusion with HTML elements like changing

    "world" 
    

    to

    "<hello>world</hello>"
    

    URL Encoding does a similar thing for string values in a URL like changing

    "hello+world = hello world"
    

    to

    "hello%2Bworld+%3D+hello+world"
    

提交回复
热议问题