зеркало из https://github.com/mozilla/pjs.git
Fixing bug 170351, adding in UTF-8 support for pref stored strings (from AJB)
This commit is contained in:
Родитель
ee88554dd8
Коммит
1b0270bea3
|
@ -915,3 +915,25 @@ function getBoolPref (prefObj, prefName, defaultValue)
|
|||
return defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
function GetUnicharPref(prefObj, prefName, defaultValue)
|
||||
{
|
||||
try {
|
||||
return prefObj.getComplexValue(prefName, Components.interfaces.nsISupportsString).data;
|
||||
}
|
||||
catch(e)
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
function SetUnicharPref(aPrefObj, aPrefName, aPrefValue)
|
||||
{
|
||||
try {
|
||||
var str = Components.classes["@mozilla.org/supports-string;1"]
|
||||
.createInstance(Components.interfaces.nsISupportsString);
|
||||
str.data = aPrefValue;
|
||||
aPrefObj.setComplexValue(aPrefName, Components.interfaces.nsISupportsString, str);
|
||||
}
|
||||
catch(e) {}
|
||||
}
|
||||
|
|
|
@ -237,7 +237,7 @@ function loadCalendarEventDialog()
|
|||
|
||||
/* Categories stuff */
|
||||
// Load categories
|
||||
var categoriesString = opener.getCharPref(opener.gCalendarWindow.calendarPreferences.calendarPref, "categories.names", getDefaultCategories() );
|
||||
var categoriesString = opener.GetUnicharPref(opener.gCalendarWindow.calendarPreferences.calendarPref, "categories.names", getDefaultCategories() );
|
||||
|
||||
var categoriesList = categoriesString.split( "," );
|
||||
|
||||
|
|
|
@ -237,7 +237,7 @@ function loadCalendarEventDialog()
|
|||
|
||||
/* Categories stuff */
|
||||
// Load categories
|
||||
var categoriesString = opener.getCharPref(opener.gCalendarWindow.calendarPreferences.calendarPref, "categories.names", getDefaultCategories() );
|
||||
var categoriesString = opener.GetUnicharPref(opener.gCalendarWindow.calendarPreferences.calendarPref, "categories.names", getDefaultCategories() );
|
||||
|
||||
var categoriesList = categoriesString.split( "," );
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче