110.html revision f05b935882198ccf7d81675736e3aeb089c5113a
1<!DOCTYPE HTML> 2<meta content=" 3text/html; charset=ISO-8859-9 4" 5http-equiv="Content-Type" 6> 7<p>Test: 8<pre><!DOCTYPE HTML> 9<meta content=" 10text/html; charset=ISO-8859-9 11" 12http-equiv="Content-Type" 13></pre> 14<p>Expected result: <span id="expected">Windows-1254</span> 15<div> 16 <style scoped> 17 .pass { background: green; color: white; padding: 0.5em; font-weight: bold; } 18 .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; } 19 </style> 20 <p>Encoding used by browser is: <span id="encoding">Script did not run.</span> 21 <p>Result: <span id="result">Script did not run.</span> 22 <script> 23 var encoding = 'unknown'; 24 if ('�' == '\u00E0') { // 0xE0 25 if ('�' == '\u2122') { // 0x99 26 if ('�' == '\u00FE') // 0xFE 27 encoding = 'Windows-1252'; 28 else if ('�' == '\u015F') 29 encoding = 'Windows-1254'; 30 else if ('�' == '\u200F') 31 encoding = 'Windows-1256'; 32 else if ('�' == '\u20AB') 33 encoding = 'Windows-1258'; 34 else 35 encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122'; 36 } else if ('�' == '\u02D9') // 0xFF 37 encoding = 'ISO-8859-3'; 38 else if ('�' == '\u0177') // 0xFE 39 encoding = 'ISO-8859-14'; 40 else if ('�' == '\u021B') 41 encoding = 'ISO-8859-16'; 42 else if ('�' == '\u015F') 43 encoding = 'ISO-8859-9'; 44 else if ('�' == '\u00BE') // 0xBE 45 encoding = 'ISO-8859-1'; 46 else if ('�' == '\u0178') 47 encoding = 'ISO-8859-15'; 48 else 49 encoding = 'unknown with 0xE0 = U+00E0'; 50 } else if ('�' == '\u0101') // 0xE0 51 encoding = 'ISO-8859-10'; 52 else if ('�' == '\u0E40') // 0xE0 53 encoding = 'ISO-8859-11'; 54 else if ('�' == '\uFFFD') { // 0xE0 55 if ('☺' == '\u263A') // 0xE2 0x98 0xBA 56 encoding = 'UTF-8'; 57 else 58 encoding = 'unknown (but ASCII-compatible)'; 59 } 60 document.getElementById('encoding').firstChild.data = encoding; 61 var expected = document.getElementById('expected').firstChild.data; 62 if (expected == '(demo - no expected result)') { 63 document.getElementById('result').firstChild.data = 'demo'; 64 } else if (encoding == expected) { 65 document.getElementById('result').firstChild.data = 'PASS'; 66 document.getElementById('result').className = 'pass'; 67 } else { 68 document.getElementById('result').firstChild.data = 'FAIL'; 69 document.getElementById('result').className = 'fail'; 70 } 71 if (parent.receivedResults) 72 parent.receivedResults(); 73 </script> 74</div> 75