| Index: Source/modules/encoding/TextEncoder.cpp
|
| diff --git a/Source/modules/encoding/TextEncoder.cpp b/Source/modules/encoding/TextEncoder.cpp
|
| index 2100fd5538833ce09236909fc095357ed3d5c5c4..aa83622e039e3a472a0ef78e931ab037414309a4 100644
|
| --- a/Source/modules/encoding/TextEncoder.cpp
|
| +++ b/Source/modules/encoding/TextEncoder.cpp
|
| @@ -43,8 +43,6 @@ PassRefPtr<TextEncoder> TextEncoder::create(const String& utfLabel, ExceptionSta
|
| {
|
| const String& encodingLabel = utfLabel.isNull() ? String("utf-8") : utfLabel;
|
|
|
| - // FIXME: Types don't match Encoding spec, e.g. "ascii" => "US-ASCII" not "UTF-8".
|
| -
|
| WTF::TextEncoding encoding(encodingLabel);
|
| if (!encoding.isValid()) {
|
| es.throwTypeError();
|
| @@ -72,7 +70,9 @@ TextEncoder::~TextEncoder()
|
|
|
| String TextEncoder::encoding() const
|
| {
|
| - return String(m_encoding.name()).lower();
|
| + String name = String(m_encoding.name()).lower();
|
| + ASSERT(name == "utf-8" || name == "utf-16le" || name == "utf-16be");
|
| + return name;
|
| }
|
|
|
| PassRefPtr<Uint8Array> TextEncoder::encode(const String& input, const Dictionary& options)
|
|
|