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

Unified Diff: Source/modules/encoding/TextDecoder.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: 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 | « LayoutTests/fast/encoding/api/encoding-names-expected.txt ('k') | Source/modules/encoding/TextEncoder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/encoding/TextDecoder.cpp
diff --git a/Source/modules/encoding/TextDecoder.cpp b/Source/modules/encoding/TextDecoder.cpp
index 69d37d050a4bf4165db0af3150655c7f24844327..a81f60f2c901f4630d2cf849c5554a05432d8899 100644
--- a/Source/modules/encoding/TextDecoder.cpp
+++ b/Source/modules/encoding/TextDecoder.cpp
@@ -68,7 +68,11 @@ TextDecoder::~TextDecoder()
String TextDecoder::encoding() const
{
- return String(m_encoding.name()).lower();
+ String name = String(m_encoding.name()).lower();
+ // The same codec is used, but WTF maintains a different name/identity for these.
+ if (name == "iso-8859-1" || name == "us-ascii")
jsbell 2013/08/27 00:21:04 This could also be done around line 44, during the
Ken Russell (switch to Gerrit) 2013/08/27 03:32:54 I defer to your judgment. If the number of aliases
+ return "windows-1252";
+ return name;
}
String TextDecoder::decode(ArrayBufferView* input, const Dictionary& options, ExceptionState& es)
« no previous file with comments | « LayoutTests/fast/encoding/api/encoding-names-expected.txt ('k') | Source/modules/encoding/TextEncoder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698