Difference between Url Encode and HTML encode

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

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

5条回答
  •  逝去的感伤
    2021-01-18 07:35

    I don't know what language you are working in, but the PHP manual for example provides good explanations.

    URLEncode

    Returns a string in which all non-alphanumeric characters except -_. have been replaced with a percent (%) sign followed by two hex digits and spaces encoded as plus (+) signs. It is encoded the same way that the posted data from a WWW form is encoded, that is the same way as in application/x-www-form-urlencoded media type. This differs from the » RFC 1738 encoding (see rawurlencode()) in that for historical reasons, spaces are encoded as plus (+) signs.

    Read on

提交回复
热议问题