| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <meta http-equiv="Content-Type" content="text/html; charset=koi8-r"> | 4 <meta http-equiv="Content-Type" content="text/html; charset=koi8-r"> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <script> | 7 <script> |
| 8 | 8 |
| 9 if (window.testRunner) | 9 if (window.testRunner) |
| 10 testRunner.dumpAsText(); | 10 testRunner.dumpAsText(); |
| 11 | 11 |
| 12 document.write("<p>Initial</p>"); | 12 document.write("<p>Initial</p>"); |
| 13 document.write("<p> document.charset: " + document.charset + "</p>"); // MS
IE | 13 document.write("<p> document.charset: " + document.charset + "</p>"); // MS
IE |
| 14 document.write("<p> document.defaultCharset: " + (document.defaultCharset ?
"defined" : "undefined") + "</p>"); // MSIE | 14 document.write("<p> document.defaultCharset: " + (document.defaultCharset ?
"defined" : "undefined") + "</p>"); // MSIE |
| 15 document.write("<p> document.characterSet: " + document.characterSet + "</p
>"); // Firefox | 15 document.write("<p> document.characterSet: " + document.characterSet + "</p
>"); // Firefox |
| 16 document.write("<p> document.inputEncoding: " + document.inputEncoding + "<
/p>"); // DOM3 | 16 document.write("<p> document.inputEncoding: " + document.inputEncoding + "<
/p>"); // DOM3 |
| 17 | 17 |
| 18 document.write("<p>Setting charset to UTF-8...</p>"); | 18 document.write("<p>Setting charset to UTF-8... (expected to have no effect)</p>"
); |
| 19 try { | 19 document.charset = "utf-8"; |
| 20 document.charset = "utf-8"; | 20 document.write("<p> document.charset: " + document.charset + "</p>"); |
| 21 document.write("<p> document.charset: " + document.charset + "</p>"); | 21 document.write("<p> document.defaultCharset: " + (document.defaultCharset ?
"defined" : "undefined") + "</p>"); |
| 22 document.write("<p> document.defaultCharset: " + (document.defaultChars
et ? "defined" : "undefined") + "</p>"); | 22 document.write("<p> document.characterSet: " + document.characterSet + "</p
>"); |
| 23 document.write("<p> document.characterSet: " + document.characterSet +
"</p>"); | 23 document.write("<p> document.inputEncoding: " + document.inputEncoding + "<
/p>"); |
| 24 document.write("<p> document.inputEncoding: " + document.inputEncoding
+ "</p>"); | |
| 25 } catch (ex) { | |
| 26 document.write("<p>Failure</p>"); | |
| 27 } | |
| 28 | |
| 29 // throws an exception in Firefox, but JavaScriptCore seems to silently ignore a
ssignment to read-only properties | |
| 30 document.write("<p>Setting characterSet to KOI8-R (expected to fail, matching Fi
refox)...</p>"); | |
| 31 try { | |
| 32 document.characterSet = "KOI8-R"; | |
| 33 document.write("<p> document.charset: " + document.charset + "</p>"); | |
| 34 document.write("<p> document.defaultCharset: " + (document.defaultChars
et ? "defined" : "undefined") + "</p>"); | |
| 35 document.write("<p> document.characterSet: " + document.characterSet +
"</p>"); | |
| 36 document.write("<p> document.inputEncoding: " + document.inputEncoding
+ "</p>"); | |
| 37 } catch (ex) { | |
| 38 document.write("<p>Failure (expected)</p>"); | |
| 39 } | |
| 40 | 24 |
| 41 </script> | 25 </script> |
| 42 </body> | 26 </body> |
| 43 <html> | 27 <html> |
| OLD | NEW |