mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-05 00:02:37 +00:00
Don't let an empty intl.charset.default pref set the document charset to
the empty string. Fall back to ISO-8859-1 in the script loader if there is no other charset set. Bug 118404, r=harishd, sr=jst
This commit is contained in:
parent
2865243e84
commit
af3700e48e
@ -691,6 +691,11 @@ nsScriptLoader::OnStreamComplete(nsIStreamLoader* aLoader,
|
||||
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "Could not get document charset!");
|
||||
|
||||
if (characterSet.IsEmpty()) {
|
||||
// fall back to ISO-8851-1, see bug 118404
|
||||
characterSet = NS_LITERAL_STRING("ISO-8859-1");
|
||||
}
|
||||
|
||||
nsCOMPtr<nsICharsetConverterManager> charsetConv =
|
||||
do_GetService(kCharsetConverterManagerCID, &rv);
|
||||
|
||||
|
@ -679,11 +679,11 @@ nsHTMLDocument::TryWeakDocTypeDefault(PRInt32& aCharsetSource,
|
||||
if (prefs) {
|
||||
nsXPIDLString defCharset;
|
||||
nsresult rv = prefs->GetLocalizedUnicharPref("intl.charset.default", getter_Copies(defCharset));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (NS_SUCCEEDED(rv) && !defCharset.IsEmpty()) {
|
||||
aCharset.Assign(defCharset);
|
||||
aCharsetSource = kCharsetFromWeakDocTypeDefault;
|
||||
}
|
||||
}
|
||||
aCharsetSource = kCharsetFromWeakDocTypeDefault;
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user