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

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: 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 | « LayoutTests/fast/encoding/api/latin-1-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..c1fad08a059c574dfb6a33ebf8b233e6d057f290 100644
--- a/Source/modules/encoding/TextDecoder.cpp
+++ b/Source/modules/encoding/TextDecoder.cpp
@@ -68,7 +68,12 @@ TextDecoder::~TextDecoder()
String TextDecoder::encoding() const
{
- return String(m_encoding.name()).lower();
+ String name = String(m_encoding.name()).lower();
+ // Where possible, encoding aliases should be handled by changes to Chromium's ICU or Blink's WTF.
+ // The same codec is used, but WTF maintains a different name/identity for these.
+ if (name == "iso-8859-1" || name == "us-ascii")
+ return "windows-1252";
+ return name;
}
String TextDecoder::decode(ArrayBufferView* input, const Dictionary& options, ExceptionState& es)
« no previous file with comments | « LayoutTests/fast/encoding/api/latin-1-expected.txt ('k') | Source/modules/encoding/TextEncoder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698