What encoding do I need to use to encode the string document.write('website%40site.com'); so that it will look like the string below?
%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%5c%22%6d%61%69%6c%74%6f%3a%63%68%75%6d%61%6b%73%68%6c%69%61%68%40%6d%61%69%6c%2e%72%75%5c%22%3e%63%68%75%6d%61%6b%73%68%6c%69%61%68%40%6d%61%69%6c%2e%72%75%3c%5c%2f%61%3e%27%29%3b
That is the same type of encoding as URL encoding, except that all characters are encoded instead of only the ones that actually need encoding. Each byte is converted into a two digit hexadecimal number, prefixed with
%.You can encode the string using UTF-8, then convert each byte to a hex code: