| Index: third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
|
| diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
|
| index f6b623e4a66c7c405b6359dd3e69193dace570c4..fa8a7dc5586973989d4d705e4462c5e711909bf4 100644
|
| --- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
|
| +++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
|
| @@ -1539,8 +1539,11 @@ PassOwnPtr<TextResourceDecoder> XMLHttpRequest::createDecoder() const
|
| if (m_responseTypeCode == ResponseTypeJSON)
|
| return TextResourceDecoder::create("application/json", "UTF-8");
|
|
|
| - if (!m_finalResponseCharset.isEmpty())
|
| - return TextResourceDecoder::create("text/plain", m_finalResponseCharset);
|
| + if (!m_finalResponseCharset.isEmpty()) {
|
| + OwnPtr<TextResourceDecoder> decoder(TextResourceDecoder::create("text/plain"));
|
| + decoder->setEncoding(WTF::TextEncoding(m_finalResponseCharset), TextResourceDecoder::EncodingFromHTTPHeader);
|
| + return decoder.release();
|
| + }
|
|
|
| // allow TextResourceDecoder to look inside the m_response if it's XML or HTML
|
| if (responseIsXML()) {
|
|
|