summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/WebKit/Source/wtf/text/TextEncoding.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/WebKit/Source/wtf/text/TextEncoding.cpp')
-rw-r--r--chromium/third_party/WebKit/Source/wtf/text/TextEncoding.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/chromium/third_party/WebKit/Source/wtf/text/TextEncoding.cpp b/chromium/third_party/WebKit/Source/wtf/text/TextEncoding.cpp
index 99d6ed8c44b..293afb4ecb6 100644
--- a/chromium/third_party/WebKit/Source/wtf/text/TextEncoding.cpp
+++ b/chromium/third_party/WebKit/Source/wtf/text/TextEncoding.cpp
@@ -45,14 +45,18 @@ static const TextEncoding& UTF7Encoding()
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
@@ -60,7 +64,7 @@ String TextEncoding::decode(const char* data, size_t length, bool stopOnError, b
if (!m_name)
return String();
- return newTextCodec(*this)->decode(data, length, true, stopOnError, sawError);
+ return newTextCodec(*this)->decode(data, length, DataEOF, stopOnError, sawError);
}
CString TextEncoding::encode(const String& string, UnencodableHandling handling) const
@@ -128,11 +132,6 @@ bool TextEncoding::usesVisualOrdering() const
return m_name == a;
}
-UChar TextEncoding::backslashAsCurrencySymbol() const
-{
- return shouldShowBackslashAsCurrencySymbolIn(m_name) ? 0x00A5 : '\\';
-}
-
bool TextEncoding::isNonByteBasedEncoding() const
{
if (noExtendedTextEncodingNameUsed()) {