snipt

Ctrl+h for KB shortcuts

JavaScript

Substituir acentos

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;
}
https://snipt.net/embed/58c796cefe2add5a2cc1a0fe55f9cd6f/
/raw/58c796cefe2add5a2cc1a0fe55f9cd6f/
58c796cefe2add5a2cc1a0fe55f9cd6f
js
JavaScript
9
2019-06-25T06:40:50
True
False
False
/api/public/snipt/28147/
substituir-acentos
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a> <a href="#L-8">8</a> <a href="#L-9">9</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="kd">function</span> <span class="nx">substituirAcentos</span><span class="p">(</span><span class="nx">str</span><span class="p">){</span> </span><span id="L-2"><a name="L-2"></a> <span class="kd">var</span> <span class="nx">map</span><span class="o">=</span><span class="p">{</span><span class="s1">&#39;À&#39;</span><span class="o">:</span><span class="s1">&#39;A&#39;</span><span class="p">,</span><span class="s1">&#39;Á&#39;</span><span class="o">:</span><span class="s1">&#39;A&#39;</span><span class="p">,</span><span class="s1">&#39;Â&#39;</span><span class="o">:</span><span class="s1">&#39;A&#39;</span><span class="p">,</span><span class="s1">&#39;Ã&#39;</span><span class="o">:</span><span class="s1">&#39;A&#39;</span><span class="p">,</span><span class="s1">&#39;Ä&#39;</span><span class="o">:</span><span class="s1">&#39;A&#39;</span><span class="p">,</span><span class="s1">&#39;Å&#39;</span><span class="o">:</span><span class="s1">&#39;A&#39;</span><span class="p">,</span><span class="s1">&#39;Æ&#39;</span><span class="o">:</span><span class="s1">&#39;AE&#39;</span><span class="p">,</span><span class="s1">&#39;Ç&#39;</span><span class="o">:</span><span class="s1">&#39;C&#39;</span><span class="p">,</span><span class="s1">&#39;È&#39;</span><span class="o">:</span><span class="s1">&#39;E&#39;</span><span class="p">,</span><span class="s1">&#39;É&#39;</span><span class="o">:</span><span class="s1">&#39;E&#39;</span><span class="p">,</span><span class="s1">&#39;Ê&#39;</span><span class="o">:</span><span class="s1">&#39;E&#39;</span><span class="p">,</span><span class="s1">&#39;Ë&#39;</span><span class="o">:</span><span class="s1">&#39;E&#39;</span><span class="p">,</span><span class="s1">&#39;Ì&#39;</span><span class="o">:</span><span class="s1">&#39;I&#39;</span><span class="p">,</span><span class="s1">&#39;Í&#39;</span><span class="o">:</span><span class="s1">&#39;I&#39;</span><span class="p">,</span><span class="s1">&#39;Î&#39;</span><span class="o">:</span><span class="s1">&#39;I&#39;</span><span class="p">,</span><span class="s1">&#39;Ï&#39;</span><span class="o">:</span><span class="s1">&#39;I&#39;</span><span class="p">,</span><span class="s1">&#39;Ð&#39;</span><span class="o">:</span><span class="s1">&#39;D&#39;</span><span class="p">,</span><span class="s1">&#39;Ñ&#39;</span><span class="o">:</span><span class="s1">&#39;N&#39;</span><span class="p">,</span><span class="s1">&#39;Ò&#39;</span><span class="o">:</span><span class="s1">&#39;O&#39;</span><span class="p">,</span><span class="s1">&#39;Ó&#39;</span><span class="o">:</span><span class="s1">&#39;O&#39;</span><span class="p">,</span><span class="s1">&#39;Ô&#39;</span><span class="o">:</span><span class="s1">&#39;O&#39;</span><span class="p">,</span><span class="s1">&#39;Õ&#39;</span><span class="o">:</span><span class="s1">&#39;O&#39;</span><span class="p">,</span><span class="s1">&#39;Ö&#39;</span><span class="o">:</span><span class="s1">&#39;O&#39;</span><span class="p">,</span><span class="s1">&#39;Ø&#39;</span><span class="o">:</span><span class="s1">&#39;O&#39;</span><span class="p">,</span><span class="s1">&#39;Ù&#39;</span><span class="o">:</span><span class="s1">&#39;U&#39;</span><span class="p">,</span><span class="s1">&#39;Ú&#39;</span><span class="o">:</span><span class="s1">&#39;U&#39;</span><span class="p">,</span><span class="s1">&#39;Û&#39;</span><span class="o">:</span><span class="s1">&#39;U&#39;</span><span class="p">,</span><span class="s1">&#39;Ü&#39;</span><span class="o">:</span><span class="s1">&#39;U&#39;</span><span class="p">,</span><span class="s1">&#39;Ý&#39;</span><span class="o">:</span><span class="s1">&#39;Y&#39;</span><span class="p">,</span><span class="s1">&#39;ß&#39;</span><span class="o">:</span><span class="s1">&#39;s&#39;</span><span class="p">,</span><span class="s1">&#39;à&#39;</span><span class="o">:</span><span class="s1">&#39;a&#39;</span><span class="p">,</span><span class="s1">&#39;á&#39;</span><span class="o">:</span><span class="s1">&#39;a&#39;</span><span class="p">,</span><span class="s1">&#39;â&#39;</span><span class="o">:</span><span class="s1">&#39;a&#39;</span><span class="p">,</span><span class="s1">&#39;ã&#39;</span><span class="o">:</span><span class="s1">&#39;a&#39;</span><span class="p">,</span><span class="s1">&#39;ä&#39;</span><span class="o">:</span><span class="s1">&#39;a&#39;</span><span class="p">,</span><span class="s1">&#39;å&#39;</span><span class="o">:</span><span class="s1">&#39;a&#39;</span><span class="p">,</span><span class="s1">&#39;æ&#39;</span><span class="o">:</span><span class="s1">&#39;ae&#39;</span><span class="p">,</span><span class="s1">&#39;ç&#39;</span><span class="o">:</span><span class="s1">&#39;c&#39;</span><span class="p">,</span><span class="s1">&#39;è&#39;</span><span class="o">:</span><span class="s1">&#39;e&#39;</span><span class="p">,</span><span class="s1">&#39;é&#39;</span><span class="o">:</span><span class="s1">&#39;e&#39;</span><span class="p">,</span><span class="s1">&#39;ê&#39;</span><span class="o">:</span><span class="s1">&#39;e&#39;</span><span class="p">,</span><span class="s1">&#39;ë&#39;</span><span class="o">:</span><span class="s1">&#39;e&#39;</span><span class="p">,</span><span class="s1">&#39;ì&#39;</span><span class="o">:</span><span class="s1">&#39;i&#39;</span><span class="p">,</span><span class="s1">&#39;í&#39;</span><span class="o">:</span><span class="s1">&#39;i&#39;</span><span class="p">,</span><span class="s1">&#39;î&#39;</span><span class="o">:</span><span class="s1">&#39;i&#39;</span><span class="p">,</span><span class="s1">&#39;ï&#39;</span><span class="o">:</span><span class="s1">&#39;i&#39;</span><span class="p">,</span><span class="s1">&#39;ñ&#39;</span><span class="o">:</span><span class="s1">&#39;n&#39;</span><span class="p">,</span><span class="s1">&#39;ò&#39;</span><span class="o">:</span><span class="s1">&#39;o&#39;</span><span class="p">,</span><span class="s1">&#39;ó&#39;</span><span class="o">:</span><span class="s1">&#39;o&#39;</span><span class="p">,</span><span class="s1">&#39;ô&#39;</span><span class="o">:</span><span class="s1">&#39;o&#39;</span><span class="p">,</span><span class="s1">&#39;õ&#39;</span><span class="o">:</span><span class="s1">&#39;o&#39;</span><span class="p">,</span><span class="s1">&#39;ö&#39;</span><span class="o">:</span><span class="s1">&#39;o&#39;</span><span class="p">,</span><span class="s1">&#39;ø&#39;</span><span class="o">:</span><span class="s1">&#39;o&#39;</span><span class="p">,</span><span class="s1">&#39;ù&#39;</span><span class="o">:</span><span class="s1">&#39;u&#39;</span><span class="p">,</span><span class="s1">&#39;ú&#39;</span><span class="o">:</span><span class="s1">&#39;u&#39;</span><span class="p">,</span><span class="s1">&#39;û&#39;</span><span class="o">:</span><span class="s1">&#39;u&#39;</span><span class="p">,</span><span class="s1">&#39;ü&#39;</span><span class="o">:</span><span class="s1">&#39;u&#39;</span><span class="p">,</span><span class="s1">&#39;ý&#39;</span><span class="o">:</span><span class="s1">&#39;y&#39;</span><span class="p">,</span><span class="s1">&#39;ÿ&#39;</span><span class="o">:</span><span class="s1">&#39;y&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;A&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;a&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;A&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;a&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;A&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;a&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;C&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;c&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;C&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;c&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;C&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;c&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;C&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;c&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;D&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;d&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;D&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;d&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;E&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;e&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;E&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;e&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;E&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;e&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;E&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;e&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;E&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;e&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;G&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;g&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;G&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;g&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;G&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;g&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;G&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;g&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;H&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;h&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;H&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;h&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;I&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;i&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;I&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;i&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;I&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;i&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;I&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;i&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;I&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;i&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;IJ&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;ij&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;J&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;j&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;K&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;k&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;L&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;l&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;L&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;l&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;L&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;l&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;L&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;l&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;L&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;l&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;N&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;n&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;N&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;n&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;N&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;n&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;n&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;O&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;o&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;O&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;o&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;O&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;o&#39;</span><span class="p">,</span><span class="s1">&#39;Œ&#39;</span><span class="o">:</span><span class="s1">&#39;OE&#39;</span><span class="p">,</span><span class="s1">&#39;œ&#39;</span><span class="o">:</span><span class="s1">&#39;oe&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;R&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;r&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;R&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;r&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;R&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;r&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;S&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;s&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;S&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;s&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;S&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;s&#39;</span><span class="p">,</span><span class="s1">&#39;Š&#39;</span><span class="o">:</span><span class="s1">&#39;S&#39;</span><span class="p">,</span><span class="s1">&#39;š&#39;</span><span class="o">:</span><span class="s1">&#39;s&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;T&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;t&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;T&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;t&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;T&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;t&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;U&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;u&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;U&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;u&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;U&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;u&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;U&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;u&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;U&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;u&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;U&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;u&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;W&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;w&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;Y&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;y&#39;</span><span class="p">,</span><span class="s1">&#39;Ÿ&#39;</span><span class="o">:</span><span class="s1">&#39;Y&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;Z&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;z&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;Z&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;z&#39;</span><span class="p">,</span><span class="s1">&#39;Ž&#39;</span><span class="o">:</span><span class="s1">&#39;Z&#39;</span><span class="p">,</span><span class="s1">&#39;ž&#39;</span><span class="o">:</span><span class="s1">&#39;z&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;s&#39;</span><span class="p">,</span><span class="s1">&#39;ƒ&#39;</span><span class="o">:</span><span class="s1">&#39;f&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;O&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;o&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;U&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;u&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;A&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;a&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;I&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;i&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;O&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;o&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;U&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;u&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;U&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;u&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;U&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;u&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;U&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;u&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;U&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;u&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;A&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;a&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;AE&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;ae&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;O&#39;</span><span class="p">,</span><span class="s1">&#39;?&#39;</span><span class="o">:</span><span class="s1">&#39;o&#39;</span><span class="p">};</span> </span><span id="L-3"><a name="L-3"></a> <span class="kd">var</span> <span class="nx">res</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span> </span><span id="L-4"><a name="L-4"></a> <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">str</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span> </span><span id="L-5"><a name="L-5"></a> <span class="nx">c</span> <span class="o">=</span> <span class="nx">str</span><span class="p">.</span><span class="nx">charAt</span><span class="p">(</span><span class="nx">i</span><span class="p">);</span> </span><span id="L-6"><a name="L-6"></a> <span class="nx">res</span> <span class="o">+=</span> <span class="nx">map</span><span class="p">[</span><span class="nx">c</span><span class="p">]</span> <span class="o">||</span> <span class="nx">c</span><span class="p">;</span> </span><span id="L-7"><a name="L-7"></a> <span class="p">}</span> </span><span id="L-8"><a name="L-8"></a> <span class="k">return</span> <span class="nx">res</span><span class="p">;</span> </span><span id="L-9"><a name="L-9"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
javascript