11cb0ef41Sopenharmony_ci// META: title=Encoding API: Legacy encodings 21cb0ef41Sopenharmony_ci// META: script=resources/encodings.js 31cb0ef41Sopenharmony_ci 41cb0ef41Sopenharmony_ciencodings_table.forEach(function(section) { 51cb0ef41Sopenharmony_ci section.encodings.forEach(function(encoding) { 61cb0ef41Sopenharmony_ci if (encoding.name !== 'replacement') { 71cb0ef41Sopenharmony_ci test(function() { 81cb0ef41Sopenharmony_ci assert_equals(new TextDecoder(encoding.name).encoding, encoding.name.toLowerCase()); // ASCII names only, so safe 91cb0ef41Sopenharmony_ci }, 'Encoding argument supported for decode: ' + encoding.name); 101cb0ef41Sopenharmony_ci } 111cb0ef41Sopenharmony_ci 121cb0ef41Sopenharmony_ci test(function() { 131cb0ef41Sopenharmony_ci assert_equals(new TextEncoder(encoding.name).encoding, 'utf-8'); 141cb0ef41Sopenharmony_ci }, 'Encoding argument not considered for encode: ' + encoding.name); 151cb0ef41Sopenharmony_ci }); 161cb0ef41Sopenharmony_ci}); 17