www

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

commit d24a87c3a4c78af06f913ccec98ec808f82d2384
parent 16f98f76e0a68121447bba723295bbc8a7b4b3e3
Author: Dan Stillman <dstillman@zotero.org>
Date:   Tue,  2 Dec 2008 10:14:03 +0000

Override response charset of MARC file in Voyager translator when known to be UTF-8 or Latin1

This fixes mangled extended characters from UPenn library's "Latin1 MARC" records, which are served without a charset and detected as UTF-8 by Firefox.


Diffstat:
Mtranslators/Library Catalog (Voyager).js | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/translators/Library Catalog (Voyager).js b/translators/Library Catalog (Voyager).js @@ -8,7 +8,7 @@ "maxVersion":"", "priority":100, "inRepository":true, - "lastUpdated":"2008-07-16 20:10:00" + "lastUpdated":"2008-12-02 10:10:00" } function detectWeb(doc, url) { @@ -132,10 +132,14 @@ function doWeb(doc, url) { } } + var responseCharset = null; + if(unicode) { var rd = unicode; + responseCharset = 'UTF-8'; } else if(latin1) { var rd = latin1; + responseCharset = 'ISO-8859-1'; } else if(raw) { var rd = raw; } else { @@ -168,6 +172,6 @@ function doWeb(doc, url) { marc.translate(); Zotero.done(); - }) + }, null, responseCharset); Zotero.wait(); } \ No newline at end of file