Skip to content

Commit

Permalink
Bug 12174 - Zotero connection with Koha: problem with UTF-8
Browse files Browse the repository at this point in the history
This patch solves the bug for UTF-8 output. MARC-8 works only if you save it as a file. In fact the standard Internet stack (browser, web server, etc.) doesn't know anything about MARC-8 or it's ISO base (ISO 2022).

To test the bug:
-- without the patch use Zotero on a recent Koha install with Apache.
You can use PTFS sandboxes. You can't use Biblibre sandboxes, they use Ngix.
-- Test a record with special chars.
-- Install the patch
-- Catch (using Zotero) the same record.
-- Test all directly download from Opac.
-- To check MARC-8, use a tool that support it. For example MarcEdit.

http://bugs.koha-community.org/show_bug.cgi?id=12174
Signed-off-by: Bernardo Gonzalez Kriegel <[email protected]>

Work as described
Tested with zotero add-on for firefox.
Before patch bad diacritics, after patch ok

Record exported as MARC-8, transformed using
yaz-iconv -f marc8 -t utf-8 bib.marc8 > bib.utf8
yaz-marcdump -i marc -o line bib.utf8, checking accents,
also comparing with direct utf-8 export

No koha-qa errors

Signed-off-by: Katrin Fischer <[email protected]>
Tested with Zotero in Firefox and with yaz-iconv as suggested by
Bernardo, no problems found.
Passes tests and QA script.

Signed-off-by: Tomas Cohen Arazi <[email protected]>
  • Loading branch information
Zeno Tajoli authored and tomascohen committed Jul 31, 2014
1 parent f804aec commit ec44d40
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions opac/opac-export.pl
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,15 @@
print $query->end_html();
}
else {
print $query->header(
-type => 'application/octet-stream',
-attachment=>"bib-$biblionumber.$format");
print $marc;
if ($format eq 'marc8'){
print $query->header(
-type => 'application/marc',
-charset=>'ISO-2022',
-attachment=>"bib-$biblionumber.$format");
}else{
print $query->header(
-type => 'application/octet-stream',
-charset=>'utf-8',
-attachment=>"bib-$biblionumber.$format");
}
}

0 comments on commit ec44d40

Please sign in to comment.