-
-
Save anonymous/70aab933384573b4bef9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var charmap = { | |
"Ş": "s", | |
"İ": "i", | |
"ı": "i", | |
"Ğ": "g", | |
"ğ": "g", | |
"Ü": "u", | |
"ü": "u", | |
"ç": "c", | |
"Ç": "c", | |
"ö": "o", | |
"Ö": "o", | |
"ş": "s", | |
"â": "a", | |
"ê": "e", | |
"î": "i", | |
"û": "u", | |
"Â": "a", | |
"Ê": "e", | |
"Î": "i", | |
"Û": "u" | |
}; | |
var re = new RegExp("[" + Object.keys(charmap).join('') +"]", "g"); | |
function Asciify(str){ | |
return str.replace(re, function (m, p, a){return charmap[m];}).toLowerCase(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment