summaryrefslogtreecommitdiff
path: root/common/content/options.js
diff options
context:
space:
mode:
authoranekos <anekos@snca.net>2009-02-18 00:11:16 +0900
committeranekos <anekos@snca.net>2009-02-18 00:11:16 +0900
commitf0ff9bf2a123077fc83208a6dbe73574dffa5163 (patch)
tree838e77dcf5afbd8c822413c144d127466f18a306 /common/content/options.js
parent71a0f56db4b972a7787e3469703460b0c10d165d (diff)
downloadpentadactyl-f0ff9bf2a123077fc83208a6dbe73574dffa5163.tar.gz
Fix: set! foo="multibyte string" was broken.
Diffstat (limited to 'common/content/options.js')
-rw-r--r--common/content/options.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/common/content/options.js b/common/content/options.js
index f997a697..7c1df76f 100644
--- a/common/content/options.js
+++ b/common/content/options.js
@@ -335,7 +335,11 @@ function Options() //{{{
{
case "string":
if (type == Ci.nsIPrefBranch.PREF_INVALID || type == Ci.nsIPrefBranch.PREF_STRING)
- services.get("pref").setCharPref(name, value);
+ {
+ let supportString = Cc["@mozilla.org/supports-string;1"].createInstance(Ci.nsISupportsString);
+ supportString.data = value;
+ services.get("pref").setComplexValue(name, Ci.nsISupportsString, supportString);
+ }
else if (type == Ci.nsIPrefBranch.PREF_INT)
liberator.echoerr("E521: Number required after =: " + name + "=" + value);
else
@@ -375,6 +379,7 @@ function Options() //{{{
case Ci.nsIPrefBranch.PREF_STRING:
let value = branch.getComplexValue(name, Ci.nsISupportsString).data;
// try in case it's a localized string (will throw an exception if not)
+ //
if (!services.get("pref").prefIsLocked(name) && !services.get("pref").prefHasUserValue(name) &&
RegExp("chrome://.+/locale/.+\\.properties").test(value))
value = branch.getComplexValue(name, Ci.nsIPrefLocalizedString).data;