mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-22 08:26:27 +00:00
LibWeb: Implement TextEncoder.prototype.encoding
This commit is contained in:
committed by
Andreas Kling
parent
f37d00c07b
commit
f8387dea26
@@ -4,6 +4,7 @@
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <LibJS/Runtime/TypedArray.h>
|
||||
#include <LibWeb/Bindings/Wrapper.h>
|
||||
#include <LibWeb/Encoding/TextEncoder.h>
|
||||
@@ -33,4 +34,11 @@ JS::Uint8Array* TextEncoder::encode(String const& input) const
|
||||
return typed_array;
|
||||
}
|
||||
|
||||
// https://encoding.spec.whatwg.org/#dom-textencoder-encoding
|
||||
FlyString const& TextEncoder::encoding()
|
||||
{
|
||||
static FlyString encoding = "utf-8"sv;
|
||||
return encoding;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user