From 7c2dd4fed5b90f11af7cf5c20011a5c3fb3a5193 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Wed, 9 May 2018 15:28:44 +0200 Subject: Add UTF-8 as a default fallback encoding for unknown encodings Issue #315 --- browser/components/preferences/fonts.xul | 3 ++- browser/locales/en-US/chrome/browser/preferences/fonts.dtd | 1 + dom/encoding/FallbackEncoding.cpp | 3 +-- modules/libpref/init/all.js | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/browser/components/preferences/fonts.xul b/browser/components/preferences/fonts.xul index ed1d1ecc2..26b1c6547 100644 --- a/browser/components/preferences/fonts.xul +++ b/browser/components/preferences/fonts.xul @@ -255,7 +255,8 @@ control="DefaultCharsetList"/> - + + diff --git a/browser/locales/en-US/chrome/browser/preferences/fonts.dtd b/browser/locales/en-US/chrome/browser/preferences/fonts.dtd index 98d697d35..d55bcde8b 100644 --- a/browser/locales/en-US/chrome/browser/preferences/fonts.dtd +++ b/browser/locales/en-US/chrome/browser/preferences/fonts.dtd @@ -70,6 +70,7 @@ + diff --git a/dom/encoding/FallbackEncoding.cpp b/dom/encoding/FallbackEncoding.cpp index 93fe0f8cb..29411412e 100644 --- a/dom/encoding/FallbackEncoding.cpp +++ b/dom/encoding/FallbackEncoding.cpp @@ -55,8 +55,7 @@ FallbackEncoding::Get(nsACString& aFallback) // Don't let the user break things by setting the override to unreasonable // values via about:config if (!EncodingUtils::FindEncodingForLabel(override, mFallback) || - !EncodingUtils::IsAsciiCompatible(mFallback) || - mFallback.EqualsLiteral("UTF-8")) { + !EncodingUtils::IsAsciiCompatible(mFallback)) { mFallback.Truncate(); } diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 88a9af2da..2bf07eb91 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -2046,7 +2046,7 @@ pref("intl.accept_languages", "chrome://global/locale/intl.propert pref("intl.menuitems.alwaysappendaccesskeys","chrome://global/locale/intl.properties"); pref("intl.menuitems.insertseparatorbeforeaccesskeys","chrome://global/locale/intl.properties"); pref("intl.charset.detector", "chrome://global/locale/intl.properties"); -pref("intl.charset.fallback.override", ""); +pref("intl.charset.fallback.override", "*"); // '*' to make sure the UI selects the proper entry for 'auto' pref("intl.charset.fallback.tld", true); pref("intl.ellipsis", "chrome://global-platform/locale/intl.properties"); pref("intl.locale.matchOS", false); -- cgit v1.2.3