If we percent encode the char "€", we will have %E2%82%AC as result. Ok!
My problem:
a = %61
I already know it.
Is it possible to encode "a" to something like %XX%XX or %XX%XX%XX?
If yes, will browsers and servers understand the result as the char "a"?
€
is Unicode codepointU+20AC EURO SIGN
. The byte sequence0xE2 0x82 0xAC
is how U+20AC is encoded in UTF-8.%E2%82%AC
is the URL encoding of those bytes.For ASCII character
a
, aka Unicode codepointU+0061 LATIN SMALL LETTER A
, that is correct. It is encoded as byte0x61
in UTF-8 (and most other charsets), and thus can be encoded as%61
in URLs.Yes. Any character can be encoded using percent encoding in a URL. Simply encode the character in the appropriate charset, and then percent-encode the resulting bytes. However, most ASCII non-reserved characters do not require such encoding, just use them as-is.
In URLs and URL-like content encodings (like
application/x-www-webform-urlencoded
), yes.