Skip to content

Instantly share code, notes, and snippets.

@alisterlf
Created August 27, 2012 18:10
Show Gist options
  • Save alisterlf/3490957 to your computer and use it in GitHub Desktop.
Save alisterlf/3490957 to your computer and use it in GitHub Desktop.

Revisions

  1. alisterlf created this gist Aug 27, 2012.
    15 changes: 15 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    function RemoveAccents(strAccents) {
    var strAccents = strAccents.split('');
    var strAccentsOut = new Array();
    var strAccentsLen = strAccents.length;
    var accents = 'ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž';
    var accentsOut = "AAAAAAaaaaaaOOOOOOOooooooEEEEeeeeeCcDIIIIiiiiUUUUuuuuNnSsYyyZz";
    for (var y = 0; y < strAccentsLen; y++) {
    if (accents.indexOf(strAccents[y]) != -1) {
    strAccentsOut[y] = accentsOut.substr(accents.indexOf(strAccents[y]), 1);
    } else
    strAccentsOut[y] = strAccents[y];
    }
    strAccentsOut = strAccentsOut.join('');
    return strAccentsOut;
    }