<!DOCTYPE HTML>
<meta charset=ISO-8859-9>
<p>Test:
<pre>&lt;!DOCTYPE HTML>
&lt;meta charset=ISO-8859-9></pre>
<p>Expected result: <span id="expected">Windows-1254</span>
<div>
 <style scoped>
  .pass { background: green; color: white; padding: 0.5em; font-weight: bold; }
  .fail { background: red; color: yellow; padding: 0.5em; font-weight: bold; }
 </style>
 <p>Encoding used by browser is: <span id="encoding">Script did not run.</span>
 <p>Result: <span id="result">Script did not run.</span>
 <script>
   var encoding = 'unknown';
   if ('' == '\u00E0') { // 0xE0
     if ('' == '\u2122') { // 0x99
       if ('' == '\u00FE') // 0xFE
         encoding = 'Windows-1252';
       else if ('' == '\u015F')
         encoding = 'Windows-1254';
       else if ('' == '\u200F')
         encoding = 'Windows-1256';
       else if ('' == '\u20AB')
         encoding = 'Windows-1258';
       else
         encoding = 'unknown with 0xE0 = U+00E0 and 0x99 = U+2122';
     } else if ('' == '\u02D9') // 0xFF
       encoding = 'ISO-8859-3';
     else if ('' == '\u0177') // 0xFE
       encoding = 'ISO-8859-14';
     else if ('' == '\u021B')
       encoding = 'ISO-8859-16';
     else if ('' == '\u015F')
       encoding = 'ISO-8859-9';
     else if ('' == '\u00BE') // 0xBE
       encoding = 'ISO-8859-1';
     else if ('' == '\u0178')
       encoding = 'ISO-8859-15';
     else
       encoding = 'unknown with 0xE0 = U+00E0';
   } else if ('' == '\u0101') // 0xE0
     encoding = 'ISO-8859-10';
   else if ('' == '\u0E40') // 0xE0
     encoding = 'ISO-8859-11';
   else if ('' == '\uFFFD') { // 0xE0
     if ('☺' == '\u263A') // 0xE2 0x98 0xBA
       encoding = 'UTF-8';
     else
       encoding = 'unknown (but ASCII-compatible)';
   }
   document.getElementById('encoding').firstChild.data = encoding;
   var expected = document.getElementById('expected').firstChild.data;
   if (expected == '(demo - no expected result)') {
     document.getElementById('result').firstChild.data = 'demo';
   } else if (encoding == expected) {
     document.getElementById('result').firstChild.data = 'PASS';
     document.getElementById('result').className = 'pass';
   } else {
     document.getElementById('result').firstChild.data = 'FAIL';
     document.getElementById('result').className = 'fail';
   }
   if (parent.receivedResults)
     parent.receivedResults();
 </script>
</div>
