Set default encoding for WebContents as UTF-8 08/179008/1
authorsurya.kumar7 <surya.kumar7@samsung.com>
Tue, 15 May 2018 08:14:21 +0000 (13:44 +0530)
committersurya.kumar7 <surya.kumar7@samsung.com>
Tue, 15 May 2018 08:18:24 +0000 (13:48 +0530)
Currently, the default encoding being used is ISO-8859-1 which is
a single-byte encoding and is capable of only supporting limited symbols.
Change it to UTF-8(multi byte encoding) just like in crosswalk to extend
support for more symbols

Change-Id: I92e70445ca668c8db8c258e4ad1a6d41816dd2fb
Signed-off-by: surya.kumar7 <surya.kumar7@samsung.com>
atom/browser/atom_browser_client.cc

index ebbd54a..9408fcf 100644 (file)
@@ -54,6 +54,8 @@ bool g_suppress_renderer_process_restart = false;
 // Custom schemes to be registered to handle service worker.
 std::string g_custom_service_worker_schemes = "";
 
+const std::string kDefaultEncoding = "UTF-8";
+
 void Noop(scoped_refptr<content::SiteInstance>) {
 }
 
@@ -161,6 +163,7 @@ void AtomBrowserClient::OverrideWebkitPrefs(
   prefs->allow_file_access_from_file_urls = true;
   prefs->experimental_webgl_enabled = true;
   prefs->allow_running_insecure_content = false;
+  prefs->default_encoding = kDefaultEncoding;
 
   // Custom preferences of guest page.
   auto web_contents = content::WebContents::FromRenderViewHost(host);