1// META: title=Encoding API: Legacy encodings 2// META: script=resources/encodings.js 3 4encodings_table.forEach(function(section) { 5 section.encodings.forEach(function(encoding) { 6 if (encoding.name !== 'replacement') { 7 test(function() { 8 assert_equals(new TextDecoder(encoding.name).encoding, encoding.name.toLowerCase()); // ASCII names only, so safe 9 }, 'Encoding argument supported for decode: ' + encoding.name); 10 } 11 12 test(function() { 13 assert_equals(new TextEncoder(encoding.name).encoding, 'utf-8'); 14 }, 'Encoding argument not considered for encode: ' + encoding.name); 15 }); 16}); 17