зеркало из https://github.com/mozilla/pjs.git
Added a force charset override support, bug 43101, r=mscott.
This commit is contained in:
Родитель
ceb46584a8
Коммит
1b7fd80131
|
@ -132,6 +132,25 @@ bridge_new_new_uri(void *bridgeStream, nsIURI *aURI)
|
|||
charset = uniCharset;
|
||||
if (NS_SUCCEEDED(rv) && !charset.IsEmpty())
|
||||
msd->options->override_charset = charset.ToNewCString();
|
||||
|
||||
// if the pref says always override and no manual override then set the folder charset to override
|
||||
// in future, the override flag to be per folder instead of a global pref
|
||||
if (charset.IsEmpty()) {
|
||||
nsresult rv;
|
||||
nsCOMPtr <nsIPref> prefs = do_GetService(kPrefCID, &rv);
|
||||
if (NS_SUCCEEDED(rv) && prefs)
|
||||
{
|
||||
PRBool force_override;
|
||||
rv = prefs->GetBoolPref("mailnews.force_charset_override", &force_override);
|
||||
if (NS_SUCCEEDED(rv) && force_override)
|
||||
{
|
||||
i18nUrl->GetFolderCharset(getter_Copies(uniCharset));
|
||||
nsAutoString charset(uniCharset);
|
||||
if (!charset.IsEmpty())
|
||||
msd->options->override_charset = charset.ToNewCString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
char *urlString;
|
||||
if (NS_SUCCEEDED(aURI->GetSpec(&urlString)))
|
||||
|
|
Загрузка…
Ссылка в новой задаче