Index: Source/wtf/text/TextEncoding.cpp |
diff --git a/Source/wtf/text/TextEncoding.cpp b/Source/wtf/text/TextEncoding.cpp |
index 9adff579120c04ae646a1759407d88bc778569a0..f232e57b2acc6613c5ad807f290a396013ef1504 100644 |
--- a/Source/wtf/text/TextEncoding.cpp |
+++ b/Source/wtf/text/TextEncoding.cpp |
@@ -47,12 +47,18 @@ TextEncoding::TextEncoding(const char* name) |
: m_name(atomicCanonicalTextEncodingName(name)) |
, m_backslashAsCurrencySymbol(backslashAsCurrencySymbol()) |
{ |
+ // Aliases are valid, but not "replacement" itself. |
+ if (m_name && isReplacementEncoding(name)) |
+ m_name = 0; |
} |
TextEncoding::TextEncoding(const String& name) |
: m_name(atomicCanonicalTextEncodingName(name)) |
, m_backslashAsCurrencySymbol(backslashAsCurrencySymbol()) |
{ |
+ // Aliases are valid, but not "replacement" itself. |
+ if (m_name && isReplacementEncoding(name)) |
+ m_name = 0; |
} |
String TextEncoding::decode(const char* data, size_t length, bool stopOnError, bool& sawError) const |