HtmlEncod 與 UrlEncode差別

摘要:HtmlEncod 與 UrlEncode差別

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

"<hello>world</hello>"

to

"&lt;hello&gt;world&lt;/hello&gt;"

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

"hello+world = hello world"

to

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