1
2
3
4
5
6
7
8
9
function substituirAcentos(str){
    var map={'À':'A','Á':'A','Â':'A','Ã':'A','Ä':'A','Å':'A','Æ':'AE','Ç':'C','È':'E','É':'E','Ê':'E','Ë':'E','Ì':'I','Í':'I','Î':'I','Ï':'I','Ð':'D','Ñ':'N','Ò':'O','Ó':'O','Ô':'O','Õ':'O','Ö':'O','Ø':'O','Ù':'U','Ú':'U','Û':'U','Ü':'U','Ý':'Y','ß':'s','à':'a','á':'a','â':'a','ã':'a','ä':'a','å':'a','æ':'ae','ç':'c','è':'e','é':'e','ê':'e','ë':'e','ì':'i','í':'i','î':'i','ï':'i','ñ':'n','ò':'o','ó':'o','ô':'o','õ':'o','ö':'o','ø':'o','ù':'u','ú':'u','û':'u','ü':'u','ý':'y','ÿ':'y','?':'A','?':'a','?':'A','?':'a','?':'A','?':'a','?':'C','?':'c','?':'C','?':'c','?':'C','?':'c','?':'C','?':'c','?':'D','?':'d','?':'D','?':'d','?':'E','?':'e','?':'E','?':'e','?':'E','?':'e','?':'E','?':'e','?':'E','?':'e','?':'G','?':'g','?':'G','?':'g','?':'G','?':'g','?':'G','?':'g','?':'H','?':'h','?':'H','?':'h','?':'I','?':'i','?':'I','?':'i','?':'I','?':'i','?':'I','?':'i','?':'I','?':'i','?':'IJ','?':'ij','?':'J','?':'j','?':'K','?':'k','?':'L','?':'l','?':'L','?':'l','?':'L','?':'l','?':'L','?':'l','?':'L','?':'l','?':'N','?':'n','?':'N','?':'n','?':'N','?':'n','?':'n','?':'O','?':'o','?':'O','?':'o','?':'O','?':'o','Œ':'OE','œ':'oe','?':'R','?':'r','?':'R','?':'r','?':'R','?':'r','?':'S','?':'s','?':'S','?':'s','?':'S','?':'s','Š':'S','š':'s','?':'T','?':'t','?':'T','?':'t','?':'T','?':'t','?':'U','?':'u','?':'U','?':'u','?':'U','?':'u','?':'U','?':'u','?':'U','?':'u','?':'U','?':'u','?':'W','?':'w','?':'Y','?':'y','Ÿ':'Y','?':'Z','?':'z','?':'Z','?':'z','Ž':'Z','ž':'z','?':'s','ƒ':'f','?':'O','?':'o','?':'U','?':'u','?':'A','?':'a','?':'I','?':'i','?':'O','?':'o','?':'U','?':'u','?':'U','?':'u','?':'U','?':'u','?':'U','?':'u','?':'U','?':'u','?':'A','?':'a','?':'AE','?':'ae','?':'O','?':'o'};
    var res = '';
    for (var i = 0; i < str.length; i++) {
        c = str.charAt(i);
        res += map[c] || c;
    }
    return res;
}