RosettaCodeData/Task/URL-decoding/Mathematica/url-decoding-1.math

5 lines
201 B
Text
Raw Permalink Normal View History

2013-04-11 01:07:29 -07:00
URLDecoding[url_] :=
StringReplace[url, "%" ~~ x_ ~~ y_ :> FromDigits[x ~~ y, 16]] //.
StringExpression[x___, Longest[n__Integer], y___] :>
StringExpression[x, FromCharacterCode[{n}, "UTF8"], y]