| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../js/resources/js-test-pre.js"></script> |
| 3 <script> |
| 4 |
| 5 description("Test the Encoding API's use of encoding names"); |
| 6 |
| 7 debug("Encoding names are case insensitive"); |
| 8 var encodings = [ |
| 9 { label: 'utf-8', encoding: 'utf-8' }, |
| 10 { label: 'utf-16', encoding: 'utf-16' }, |
| 11 { label: 'utf-16le', encoding: 'utf-16' }, |
| 12 { label: 'utf-16be', encoding: 'utf-16be' }, |
| 13 { label: 'ascii', encoding: 'windows-1252' }, |
| 14 { label: 'iso-8859-1', encoding: 'windows-1252' } |
| 15 ]; |
| 16 |
| 17 // FIXME: Include full table from spec |
| 18 |
| 19 encodings.forEach(function(test) { |
| 20 shouldBeEqualToString("new TextDecoder('" + test.label.toLowerCase() + "').e
ncoding", test.encoding); |
| 21 shouldBeEqualToString("new TextDecoder('" + test.label.toUpperCase() + "').e
ncoding", test.encoding); |
| 22 }); |
| 23 |
| 24 |
| 25 shouldBeEqualToString("new TextDecoder('utf-8').encoding", "utf-8"); // canonica
l case |
| 26 shouldBeEqualToString("new TextDecoder('UTF-16').encoding", "utf-16"); // canoni
cal case and name |
| 27 shouldBeEqualToString("new TextDecoder('UTF-16BE').encoding", "utf-16be"); // ca
nonical case and name |
| 28 shouldBeEqualToString("new TextDecoder('iso8859-1').encoding", "windows-1252");
// canonical case and name |
| 29 shouldBeEqualToString("new TextDecoder('iso-8859-1').encoding", "windows-1252");
// canonical case and name |
| 30 |
| 31 </script> |
| 32 <script src="../../js/resources/js-test-post.js"></script> |
| OLD | NEW |