www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 6a68139591e18447ea7f1e99c59c0a9e07f6d585
parent bfa7b5b1533cda86e2f092961e42e60e440d05c0
Author: Simon Kornblith <simon@simonster.com>
Date:   Thu, 16 Feb 2012 03:50:26 -0500

charset is a complex value in newer Fx versions

probably fixes http://forums.zotero.org/discussion/21956/zotero-wont-accept-ris-file/#Item_2

Diffstat:
Mchrome/content/zotero/xpcom/translation/translate_firefox.js | 18+++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/chrome/content/zotero/xpcom/translation/translate_firefox.js b/chrome/content/zotero/xpcom/translation/translate_firefox.js @@ -332,10 +332,22 @@ Zotero.Translate.IO.Read = function(file, mode) { // if the regexp continues to fail, this is not UTF-8 if(!isUTF8) { // Can't be UTF-8; see if a default charset is defined - this._charset = Zotero.Prefs.get("intl.charset.default", true); + var prefs = Components.classes["@mozilla.org/preferences-service;1"] + .getService(Components.interfaces.nsIPrefBranch); + try { + this._charset = prefs.getComplexValue("intl.charset.default", + Components.interfaces.nsIPrefLocalizedString).toString(); + } catch(e) {} - // ISO-8859-1 by default - if(!this._charset) this._charset = "ISO-8859-1"; + if(!this._charset) { + try { + this._charset = prefs.getCharPref("intl.charset.default"); + } catch(e) {} + + + // ISO-8859-1 by default + if(!this._charset) this._charset = "ISO-8859-1"; + } break; }