Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1238)

Unified Diff: Source/modules/encoding/TextEncoder.cpp

Issue 23455007: Encoding API: Use 'windows-1252' as name for 'us-ascii' 'iso-8859-1' (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove control characters from expected.txt Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/encoding/TextDecoder.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « Source/modules/encoding/TextDecoder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698