jamshark70's code

Decode %hex encoded characters

15 Oct'18 03:57 in utilitystringhex

A quick utility function for decoding UTF-8 characters in %hex codes (such as for web URLs). Save the code into a .sc file in your Extensions/ directory, recompile, and then: "%E5%A4%A7%E5%AE%B6%E5%A5%BD".decodeHex; -> 大家好 This probably works only for UTF-8. SC can save the individual bytes of Unicode characters into String objects, and the IDE will print UTF-8 code points correctly, but there is no way to switch the IDE to other Unicode variants.

Used classes