https://github.com/web-platform-tests/wpt
Raw File
Tip revision: fda5b2f7c785b32ad563e3bf0c28e407d0199bad authored by Florian Rivoal on 30 March 2018, 04:19:15 UTC
[css-align] Fix typo and clean-up markup
Tip revision: fda5b2f
textencoder-constructor-non-utf.html
<!DOCTYPE html>
<title>Encoding API: Legacy encodings</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/encodings.js"></script>
<script>

encodings_table.forEach(function(section) {
    section.encodings.forEach(function(encoding) {
        if (encoding.name !== 'replacement') {
            test(function() {
                assert_equals(new TextDecoder(encoding.name).encoding, encoding.name.toLowerCase()); // ASCII names only, so safe
            }, 'Encoding argument supported for decode: ' + encoding.name);
        }

        test(function() {
            assert_equals(new TextEncoder(encoding.name).encoding, 'utf-8');
        }, 'Encoding argument not considered for encode: ' + encoding.name);
    });
});

</script>
back to top