This commit is contained in:
ftang%netscape.com 2000-08-18 00:47:03 +00:00
Родитель 3ce4b2166d
Коммит 600d7b5dfb
8 изменённых файлов: 33 добавлений и 31 удалений

Просмотреть файл

@ -164,14 +164,14 @@ MyPrefChangedCallback(const char*aPrefName, void* instance_data)
{
nsresult rv;
NS_WITH_SERVICE(nsIPref, prefs, "component://netscape/preferences", &rv);
char* detector_name = nsnull;
PRUnichar* detector_name = nsnull;
if(NS_SUCCEEDED(rv) && NS_SUCCEEDED(
rv = prefs->CopyCharPref("intl.charset.detector",
rv = prefs->GetLocalizedUnicharPref("intl.charset.detector",
&detector_name)))
{
if(nsCRT::strlen(detector_name) > 0) {
PL_strncpy(g_detector_progid, NS_CHARSET_DETECTOR_PROGID_BASE,DETECTOR_PROGID_MAX);
PL_strncat(g_detector_progid, detector_name,DETECTOR_PROGID_MAX);
PL_strncat(g_detector_progid, NS_ConvertUCS2toUTF8(detector_name),DETECTOR_PROGID_MAX);
gPlugDetector = PR_TRUE;
} else {
g_detector_progid[0]=0;
@ -757,13 +757,13 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
nsCOMPtr<nsIPref> pref(do_GetService(NS_PREF_PROGID));
if(pref)
{
char* detector_name = nsnull;
PRUnichar* detector_name = nsnull;
if(NS_SUCCEEDED(
rv_detect = pref->CopyCharPref("intl.charset.detector",
rv_detect = pref->GetLocalizedUnicharPref("intl.charset.detector",
&detector_name)))
{
PL_strncpy(g_detector_progid, NS_CHARSET_DETECTOR_PROGID_BASE,DETECTOR_PROGID_MAX);
PL_strncat(g_detector_progid, detector_name,DETECTOR_PROGID_MAX);
PL_strncat(g_detector_progid, NS_ConvertUCS2toUTF8(detector_name),DETECTOR_PROGID_MAX);
gPlugDetector = PR_TRUE;
PR_FREEIF(detector_name);
}

Просмотреть файл

@ -108,14 +108,14 @@ MyPrefChangedCallback(const char*aPrefName, void* instance_data)
{
nsresult rv;
NS_WITH_SERVICE(nsIPref, prefs, "component://netscape/preferences", &rv);
char* detector_name = nsnull;
PRUnichar* detector_name = nsnull;
if(NS_SUCCEEDED(rv) && NS_SUCCEEDED(
rv = prefs->CopyCharPref("intl.charset.detector",
rv = prefs->GetLocalizedUnicharPref("intl.charset.detector",
&detector_name)))
{
if(nsCRT::strlen(detector_name) > 0) {
PL_strncpy(g_detector_progid, NS_CHARSET_DETECTOR_PROGID_BASE,DETECTOR_PROGID_MAX);
PL_strncat(g_detector_progid, detector_name,DETECTOR_PROGID_MAX);
PL_strncat(g_detector_progid, NS_ConvertUCS2toUTF8(detector_name),DETECTOR_PROGID_MAX);
gPlugDetector = PR_TRUE;
} else {
g_detector_progid[0]=0;
@ -502,13 +502,13 @@ nsXMLDocument::StartDocumentLoad(const char* aCommand,
nsCOMPtr<nsIPref> pref(do_GetService(NS_PREF_PROGID));
if(pref)
{
char* detector_name = nsnull;
PRUnichar* detector_name = nsnull;
if(NS_SUCCEEDED(
rv_detect = pref->CopyCharPref("intl.charset.detector",
rv_detect = pref->GetLocalizedUnicharPref("intl.charset.detector",
&detector_name)))
{
PL_strncpy(g_detector_progid, NS_CHARSET_DETECTOR_PROGID_BASE,DETECTOR_PROGID_MAX);
PL_strncat(g_detector_progid, detector_name,DETECTOR_PROGID_MAX);
PL_strncat(g_detector_progid, NS_ConvertUCS2toUTF8(detector_name),DETECTOR_PROGID_MAX);
gPlugDetector = PR_TRUE;
PR_FREEIF(detector_name);
}

Просмотреть файл

@ -164,14 +164,14 @@ MyPrefChangedCallback(const char*aPrefName, void* instance_data)
{
nsresult rv;
NS_WITH_SERVICE(nsIPref, prefs, "component://netscape/preferences", &rv);
char* detector_name = nsnull;
PRUnichar* detector_name = nsnull;
if(NS_SUCCEEDED(rv) && NS_SUCCEEDED(
rv = prefs->CopyCharPref("intl.charset.detector",
rv = prefs->GetLocalizedUnicharPref("intl.charset.detector",
&detector_name)))
{
if(nsCRT::strlen(detector_name) > 0) {
PL_strncpy(g_detector_progid, NS_CHARSET_DETECTOR_PROGID_BASE,DETECTOR_PROGID_MAX);
PL_strncat(g_detector_progid, detector_name,DETECTOR_PROGID_MAX);
PL_strncat(g_detector_progid, NS_ConvertUCS2toUTF8(detector_name),DETECTOR_PROGID_MAX);
gPlugDetector = PR_TRUE;
} else {
g_detector_progid[0]=0;
@ -757,13 +757,13 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
nsCOMPtr<nsIPref> pref(do_GetService(NS_PREF_PROGID));
if(pref)
{
char* detector_name = nsnull;
PRUnichar* detector_name = nsnull;
if(NS_SUCCEEDED(
rv_detect = pref->CopyCharPref("intl.charset.detector",
rv_detect = pref->GetLocalizedUnicharPref("intl.charset.detector",
&detector_name)))
{
PL_strncpy(g_detector_progid, NS_CHARSET_DETECTOR_PROGID_BASE,DETECTOR_PROGID_MAX);
PL_strncat(g_detector_progid, detector_name,DETECTOR_PROGID_MAX);
PL_strncat(g_detector_progid, NS_ConvertUCS2toUTF8(detector_name),DETECTOR_PROGID_MAX);
gPlugDetector = PR_TRUE;
PR_FREEIF(detector_name);
}

Просмотреть файл

@ -108,14 +108,14 @@ MyPrefChangedCallback(const char*aPrefName, void* instance_data)
{
nsresult rv;
NS_WITH_SERVICE(nsIPref, prefs, "component://netscape/preferences", &rv);
char* detector_name = nsnull;
PRUnichar* detector_name = nsnull;
if(NS_SUCCEEDED(rv) && NS_SUCCEEDED(
rv = prefs->CopyCharPref("intl.charset.detector",
rv = prefs->GetLocalizedUnicharPref("intl.charset.detector",
&detector_name)))
{
if(nsCRT::strlen(detector_name) > 0) {
PL_strncpy(g_detector_progid, NS_CHARSET_DETECTOR_PROGID_BASE,DETECTOR_PROGID_MAX);
PL_strncat(g_detector_progid, detector_name,DETECTOR_PROGID_MAX);
PL_strncat(g_detector_progid, NS_ConvertUCS2toUTF8(detector_name),DETECTOR_PROGID_MAX);
gPlugDetector = PR_TRUE;
} else {
g_detector_progid[0]=0;
@ -502,13 +502,13 @@ nsXMLDocument::StartDocumentLoad(const char* aCommand,
nsCOMPtr<nsIPref> pref(do_GetService(NS_PREF_PROGID));
if(pref)
{
char* detector_name = nsnull;
PRUnichar* detector_name = nsnull;
if(NS_SUCCEEDED(
rv_detect = pref->CopyCharPref("intl.charset.detector",
rv_detect = pref->GetLocalizedUnicharPref("intl.charset.detector",
&detector_name)))
{
PL_strncpy(g_detector_progid, NS_CHARSET_DETECTOR_PROGID_BASE,DETECTOR_PROGID_MAX);
PL_strncat(g_detector_progid, detector_name,DETECTOR_PROGID_MAX);
PL_strncat(g_detector_progid, NS_ConvertUCS2toUTF8(detector_name),DETECTOR_PROGID_MAX);
gPlugDetector = PR_TRUE;
PR_FREEIF(detector_name);
}

Просмотреть файл

@ -1264,17 +1264,17 @@ PRInt32 MimeCharsetConverterClass::Initialize(const char* from_charset, const ch
if (mAutoDetect) {
char detector_progid[128];
char* detector_name = nsnull;
PRUnichar* detector_name = nsnull;
PL_strcpy(detector_progid, NS_STRCDETECTOR_PROGID_BASE);
NS_WITH_SERVICE(nsIPref, prefs, kPrefCID, &res);
if (NS_SUCCEEDED(res)) {
if (NS_SUCCEEDED(prefs->CopyCharPref("mail.charset.detector", &detector_name))) {
PL_strcat(detector_progid, detector_name);
if (NS_SUCCEEDED(prefs->CopyUnicharPref("mail.charset.detector", &detector_name))) {
PL_strcat(detector_progid, NS_ConvertUCS2toUTF8(detector_name));
PR_FREEIF(detector_name);
}
else if (NS_SUCCEEDED(prefs->CopyCharPref("intl.charset.detector", &detector_name))) {
PL_strcat(detector_progid, detector_name);
else if (NS_SUCCEEDED(prefs->GetLocalizedUnicharPref("intl.charset.detector", &detector_name))) {
PL_strcat(detector_progid, NS_ConvertUCS2toUTF8(detector_name));
PR_FREEIF(detector_name);
}
}

Просмотреть файл

@ -324,7 +324,7 @@ pref("intl.charsetmenu.browser.static", "chrome://navigator/locale/navigator
pref("intl.charsetmenu.mailedit", "chrome://navigator/locale/navigator.properties");
pref("intl.charsetmenu.browser.cache", "");
pref("intl.charsetmenu.browser.cache.size", 5);
pref("intl.charset.detector", "");
pref("intl.charset.detector", "chrome://navigator/locale/navigator.properties");
pref("intl.charset.default", "chrome://navigator/locale/navigator.properties");
pref("font.default", "serif");

Просмотреть файл

@ -33,6 +33,7 @@ general.useragent.locale=en-US
intl.accept_languages=en
intl.charsetmenu.browser.static=iso-8859-1
intl.charset.default=ISO-8859-1
intl.charset.detector=
intl.charsetmenu.mailedit=iso-8859-1, ISO-8859-15, armscii-8, ISO-8859-4, ISO-8859-14, ISO-8859-2, GB2312, Big5, KOI8-R, windows-1251, KOI8-U, ISO-8859-7, ISO-2022-JP, EUC-KR, ISO-8859-10, ISO-8859-3, TIS-620, ISO-8859-9, UTF-8, VISCII
wallet.Server=http://www.mozilla.org/wallet/tables/
wallet.Samples=http://www.mozilla.org/wallet/samples/

Просмотреть файл

@ -154,8 +154,9 @@ function UpdateCharsetDetector()
}
if (pref) {
prefvalue = pref.CopyCharPref("intl.charset.detector");
prefvalue = pref.getLocalizedUnicharPref("intl.charset.detector");
if (prefvalue == "") prefvalue = "off";
dump("intl.charset.detector = "+ prefvalue + "\n");
}
var prefvalue = 'chardet.' + prefvalue;