Bugzilla – Attachment 92606 Details for
Bug 23542
SRU import encoding issue
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23542: fix SRU import ending issue
Bug-23542-fix-SRU-import-ending-issue.patch (text/plain), 2.14 KB, created by
Fridolin Somers
on 2019-09-05 12:56:33 UTC
(
hide
)
Description:
Bug 23542: fix SRU import ending issue
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2019-09-05 12:56:33 UTC
Size:
2.14 KB
patch
obsolete
>From 74590a927a647efb29bf244710ab85e73c71be10 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Thu, 5 Sep 2019 14:32:48 +0200 >Subject: [PATCH] Bug 23542: fix SRU import ending issue > >When importing records from a SRU server, the diacritics have bad encoding. >I reproduce with BNF server so it may be a UNIMARC issue. >Looks like this does not affect autorities import for SRU server. > >In C4::Breeding::_handle_one_result(), in case of a Z39.50 server, when creating MARC::Record MarcToUTF8Record() is called which calls SetMarcUnicodeFlag(). This ensures that leader indicates UTF-8 encoding. >Looking at MARC::Record->encoding() shows that encoding depends on leader even for UNIMARC. >So this patch adds a call to SetMarcUnicodeFlag() in cas of a SRU server in C4::Breeding::_handle_one_result(). > >Test plan : >1) Use a UNIMARC database >2) Configure a connexion to a UNIMARC SRU, for example BNF, > see https://doc.biblibre.com/koha/autour_de_koha/serveurs_z3950_sru#serveur_de_la_bnf >3) Go to cataloguing module >4) Click on 'New from Z39.50/SRU' >5) Choose only the SRU target >6) Search for ISBN 2266072889 >7) Confirm you see good encoding : diacritic on 'a' of title 'Strate-a-gemmes' >8) Click on 'Marc preview' >9) Confirm you see good encoding >10) Click import >11) Confirm you see good encoding >12) Check SRU connexion on a MARC21 database is still OK >--- > C4/Breeding.pm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/C4/Breeding.pm b/C4/Breeding.pm >index 8f3e4a8c69..da89f6a81b 100644 >--- a/C4/Breeding.pm >+++ b/C4/Breeding.pm >@@ -291,8 +291,8 @@ sub _handle_one_result { > my $raw= $zoomrec->raw(); > my $marcrecord; > if( $servhref->{servertype} eq 'sru' ) { >- $marcrecord= MARC::Record->new_from_xml( $raw, 'UTF-8', >- $servhref->{syntax} ); >+ $marcrecord = MARC::Record->new_from_xml( $raw, 'UTF-8', $servhref->{syntax} ); >+ SetMarcUnicodeFlag( $marcrecord, C4::Context->preference("marcflavour") ); > } else { > ($marcrecord) = MarcToUTF8Record($raw, C4::Context->preference('marcflavour'), $servhref->{encoding} // "iso-5426" ); #ignores charset return values > } >-- >2.17.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 23542
:
92606
|
93588
|
106397
|
106399
|
106400
|
106487
|
108059