summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/encoding/textencoder-constructor-non-utf.html
blob: f5c2ea545091dcb39bf70b8f92e1c3d4975b166f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!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);
            }, '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>