I have this loop that decodes the names in array "persons":
for(var idxT in persons){
var name = persons[idxT];
name = decodeURIComponent(escape(name ));
players[idxT] = name ;
} //endFor
It decodes well the first 2 names, but when arrives at the third name (name = "AntÃnio Nunes") logs this on the console:
Uncaught URIError: URI malformed
NOTE: The names in the array where previously encoded in php with "utf8_encode
"
The problem is this character "ó". How can i handle this in a way that can decode all the names?
Thanks