mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 05:47:34 +00:00
LibWeb: Add TextEncoder encodeInto
This commit is contained in:
parent
f1ead552ce
commit
0104225d9b
9 changed files with 123 additions and 10 deletions
12
Tests/LibWeb/Text/input/Encoding/TextDecoder-decode.html
Normal file
12
Tests/LibWeb/Text/input/Encoding/TextDecoder-decode.html
Normal file
|
@ -0,0 +1,12 @@
|
|||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
try {
|
||||
let decoder = new TextDecoder("utf-8");
|
||||
println(`[${decoder.decode(new Uint8Array([0x41, 0x42, 0x43]))}]`); // "ABC"
|
||||
println(`[${decoder.decode()}]`);
|
||||
} catch(e) {
|
||||
println("ERROR: " + e.name + ": " + e.message);
|
||||
}
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue