From: jh5.cho Date: Wed, 5 Aug 2015 10:14:43 +0000 (+0900) Subject: Add defense code that sets default text encoding X-Git-Tag: submit/tizen/20150921.093222~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2a9918b0739165fd2fe82a30e60bc11abe8548c4;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git Add defense code that sets default text encoding Change-Id: I11798e4ccc0850d1996a42661b20ffa37f6859a6 --- diff --git a/src/runtime/web_view_impl.cc b/src/runtime/web_view_impl.cc index 7f51c1ed3..f81733907 100755 --- a/src/runtime/web_view_impl.cc +++ b/src/runtime/web_view_impl.cc @@ -789,10 +789,15 @@ void WebViewImpl::SetCSPRule(const std::string& rule, bool report_only) { } void WebViewImpl::SetDefaultEncoding(const std::string& encoding) { - if (ewk_settings_is_encoding_valid(encoding.c_str())) { - Ewk_Settings* settings = ewk_view_settings_get(ewk_view_); + Ewk_Settings* settings = ewk_view_settings_get(ewk_view_); + + if (ewk_settings_is_encoding_valid(encoding.c_str())) ewk_settings_default_text_encoding_name_set(settings, encoding.c_str()); - } + else + ewk_settings_default_text_encoding_name_set(settings, kDefaultEncoding); + // TODO(jh5.cho) : It is required to set an encoding value again to apply it + // to the document.characterSet for unkown reason. ewk api seems to be fixed + } } // namespace wrt