From 129ab9bfc3625dd85c58b9e7d8196d90c2e665ab Mon Sep 17 00:00:00 2001 From: Zbigniew Kostrzewa Date: Thu, 11 Apr 2013 16:47:29 +0200 Subject: [PATCH] Fix overwriting value of content's encoding attribute by type attribute. [Issue#] N/A [Problem] Though content encoding is specified the actual encoding value is taken from type attribute if type attribute is set after encoding attribute in the configuration file. [Cause] Value from the last attribute parsed overwrites encoding of the page even if it has been already read from encoding attribute. [Solution] Check while parsing type attribute whether encoding has already been set. [SCMRequest] N/A [Verification] 1. Build repository. 2. Run `wrt-extra-tests-w3c --output=text --regexp='ta_aaaaaaaaaa_z1'` Change-Id: Ie49f4caf4111e3de00394a203acc3cee805d33de --- src/configuration_parser/widget_parser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/configuration_parser/widget_parser.cpp b/src/configuration_parser/widget_parser.cpp index 39b139c..a7e68d5 100644 --- a/src/configuration_parser/widget_parser.cpp +++ b/src/configuration_parser/widget_parser.cpp @@ -702,7 +702,8 @@ class ContentParser : public ElementParser m_type = value; MimeTypeUtils::MimeAttributes mimeAttributes = MimeTypeUtils::getMimeAttributes(value); - if (mimeAttributes.count(L"charset") > 0) { + if ((mimeAttributes.count(L"charset") > 0) && m_encoding.IsNull()) + { m_encoding = mimeAttributes[L"charset"]; } } else if (attribute.name == L"encoding") { -- 2.7.4