Decodeuricomponent Throwing An Error 'uri Malformed'
As unescape has been deprecated I have chosen decodeURIComponent , but it doesn't work as expected . decodeURIComponent cant decode the following URI component Coast%20Guard%20Ac
Solution 1:
The %91
and %92
characters were encoded using an ANSI codepage. decodeURIComponent()
expects the string to have been encoded as UTF-8:
The
decodeURIComponent
function computes a new version of a URI in which each escape sequence and UTF-8 encoding of the sort that might be introduced by theencodeURIComponent
function is replaced with the character that it represents.
The two quotes should be encoded as %E2%80%98
and %E2%80%99
.
Post a Comment for "Decodeuricomponent Throwing An Error 'uri Malformed'"