Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>For what it's worth, at one point I had build this mapping of Latin-1 unicode codepoints to their ascii counterparts.</p> <p>You would use this as:</p> <pre><code>var effectiveCharCode = CODE_NO_DIACRITICS[actualCharCode]; </code></pre> <p>So, a string comparison method where &lt;0 (s1 &lt; s2), 0 (s1 == s2), >0 (s1 > s2) might be like:</p> <pre><code>function compareIgnoringDiacritics(s1, s2) { for(var i = 0; i &lt; s1.length &amp;&amp; i &lt; s2.length; i++){ var cmp; if((cmp = ((CODE_NO_DIACRITICS[s1.charCodeAt(i)] - CODE_NO_DIACRITICS[s2.charCodeAt(i)]))) != 0){ return cmp; } } return s1.length - s2.length; } </code></pre> <p>Here's the table:</p> <pre><code>var CODE_NO_DIACRITICS = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 65, 65, 65, 65, 65, 65, 198, 67, 69, 69, 69, 69, 73, 73, 73, 73, 68, 78, 79, 79, 79, 79, 79, 215, 79, 85, 85, 85, 85, 89, 222, 223, 65, 65, 65, 65, 65, 65, 230, 67, 69, 69, 69, 69, 73, 73, 73, 73, 240, 78, 79, 79, 79, 79, 79, 247, 79, 85, 85, 85, 85, 89, 254, 89 ]; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload