From d24a87c3a4c78af06f913ccec98ec808f82d2384 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 2 Dec 2008 10:14:03 +0000 Subject: [PATCH] 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. --- translators/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 index 5b592df92..a8f0ec973 100644 --- 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