From a14159f712922ccd0cb9a02c3142e6aa0ad4ae83 Mon Sep 17 00:00:00 2001 From: Adam Banasiak Date: Tue, 17 Sep 2013 15:27:47 +0200 Subject: [PATCH] Problem with encoding in WRT [Issue#] WGL-427 [Problem] No validation of default encoding in WRT [Cause] N/A [Solution] Add encoding validation to WRT. Set default encoding to UTF-8 [Verification] 1. Build repository 2. Download (http://cam.sprc.samsung.pl/secure/attachment/42428/e7.wgt) and install e7.wgt 3. Launch the widget Change-Id: I317ebec5bc37d62b41b778166469f6d153d045df --- src/view/webkit/view_logic.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/view/webkit/view_logic.cpp b/src/view/webkit/view_logic.cpp index 3a3d750..2f98736 100644 --- a/src/view/webkit/view_logic.cpp +++ b/src/view/webkit/view_logic.cpp @@ -787,14 +787,20 @@ void ViewLogic::prepareEwkView(Evas_Object *wkView) OptionalWidgetStartFileInfo fileInfo = W3CFileLocalization::getStartFileInfo(m_model->TizenId); if (!fileInfo.IsNull()) { - encoding = DPL::ToUTF8String((*fileInfo).encoding); - LogDebug("Found custom encoding in DB: " << encoding); + std::string file_encoding = DPL::ToUTF8String((*fileInfo).encoding); + + if(EINA_TRUE == ewk_settings_is_encoding_valid( + file_encoding.c_str())){ + encoding = file_encoding; + _D("Found custom encoding in DB: %s", encoding.c_str()); + } + } - LogDebug("Setting encoding: " << encoding); + _D("Setting encoding: %s", encoding.c_str()); if (ewk_settings_default_encoding_set(settings,encoding.c_str())) { - LogDebug("Encoding set properly"); + _D("Encoding set properly"); } else { - LogError("Error while setting encoding"); + _E("Error while setting encoding"); } #ifdef CSP_ENABLED -- 2.7.4