OLD | NEW |
1 Test invalid UTF-16 surrogate pairs with UTF-8 encoding | 1 This is a testharness.js-based test. |
| 2 PASS Invalid surrogate pairs encoded into UTF-8: Sanity check |
| 3 PASS Invalid surrogate pairs encoded into UTF-8: Surrogate half (low) |
| 4 PASS Invalid surrogate pairs encoded into UTF-8: Surrogate half (high) |
| 5 PASS Invalid surrogate pairs encoded into UTF-8: Surrogate half (low), in a stri
ng |
| 6 PASS Invalid surrogate pairs encoded into UTF-8: Surrogate half (high), in a str
ing |
| 7 PASS Invalid surrogate pairs encoded into UTF-8: Wrong order |
| 8 Harness: the test ran to completion. |
2 | 9 |
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | |
4 | |
5 | |
6 encoded = new TextEncoder('utf-8').encode('abc123') | |
7 PASS JSON.stringify([].slice.call(encoded)) is "[97,98,99,49,50,51]" | |
8 | |
9 encoded = new TextEncoder('utf-8').encode('\ud800') | |
10 PASS JSON.stringify([].slice.call(encoded)) is "[239,191,189]" | |
11 | |
12 encoded = new TextEncoder('utf-8').encode('\udc00') | |
13 PASS JSON.stringify([].slice.call(encoded)) is "[239,191,189]" | |
14 | |
15 encoded = new TextEncoder('utf-8').encode('abc\ud800123') | |
16 PASS JSON.stringify([].slice.call(encoded)) is "[97,98,99,239,191,189,49,50,51]" | |
17 | |
18 encoded = new TextEncoder('utf-8').encode('abc\udc00123') | |
19 PASS JSON.stringify([].slice.call(encoded)) is "[97,98,99,239,191,189,49,50,51]" | |
20 | |
21 encoded = new TextEncoder('utf-8').encode('\udc00\ud800') | |
22 PASS JSON.stringify([].slice.call(encoded)) is "[239,191,189,239,191,189]" | |
23 | |
24 PASS successfullyParsed is true | |
25 | |
26 TEST COMPLETE | |
27 | |
OLD | NEW |