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