Bug 1071816 - Add a pref to fallback to UTF-8 for files from file: URLs. r=hsivonen
MozReview-Commit-ID: KFjIqYmgzTl
This commit is contained in:
@@ -486,6 +486,12 @@ nsHTMLDocument::TryFallback(int32_t& aCharsetSource,
|
||||
return;
|
||||
|
||||
aCharsetSource = kCharsetFromFallback;
|
||||
bool isFile = false;
|
||||
if (FallbackEncoding::sFallbackToUTF8ForFile && mDocumentURI &&
|
||||
NS_SUCCEEDED(mDocumentURI->SchemeIs("file", &isFile)) && isFile) {
|
||||
aEncoding = UTF_8_ENCODING;
|
||||
return;
|
||||
}
|
||||
aEncoding = FallbackEncoding::FromLocale();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user