| <html> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=koi8-r"> |
| </head> |
| <body> |
| <script> |
| |
| if (window.layoutTestController) |
| layoutTestController.dumpAsText(); |
| |
| document.write("<p>Initial</p>"); |
| document.write("<p> document.charset: " + document.charset + "</p>"); // MSIE |
| document.write("<p> document.defaultCharset: " + (document.defaultCharset ? "defined" : "undefined") + "</p>"); // MSIE |
| document.write("<p> document.characterSet: " + document.characterSet + "</p>"); // Firefox |
| document.write("<p> document.inputEncoding: " + document.inputEncoding + "</p>"); // DOM3 |
| |
| document.write("<p>Setting charset to UTF-8...</p>"); |
| try { |
| document.charset = "utf-8"; |
| document.write("<p> document.charset: " + document.charset + "</p>"); |
| document.write("<p> document.defaultCharset: " + (document.defaultCharset ? "defined" : "undefined") + "</p>"); |
| document.write("<p> document.characterSet: " + document.characterSet + "</p>"); |
| document.write("<p> document.inputEncoding: " + document.inputEncoding + "</p>"); |
| } catch (ex) { |
| document.write("<p>Failure</p>"); |
| } |
| |
| // throws an exception in Firefox, but JavaScriptCore seems to silently ignore assignment to read-only properties |
| document.write("<p>Setting characterSet to KOI8-R (expected to fail, matching Firefox)...</p>"); |
| try { |
| document.characterSet = "KOI8-R"; |
| document.write("<p> document.charset: " + document.charset + "</p>"); |
| document.write("<p> document.defaultCharset: " + (document.defaultCharset ? "defined" : "undefined") + "</p>"); |
| document.write("<p> document.characterSet: " + document.characterSet + "</p>"); |
| document.write("<p> document.inputEncoding: " + document.inputEncoding + "</p>"); |
| } catch (ex) { |
| document.write("<p>Failure (expected)</p>"); |
| } |
| |
| </script> |
| </body> |
| <html> |