Koha/C4
Fridolin Somers 19d9ba176d Bug 23542: Fix SRU import encoding
When importing records from a SRU server, the diacritics have bad encoding.
I reproduce with BNF server so it may be a UNIMARC issue.

Tests show that difference between Z39.50 server and SRU is that leader contains 'a' at postion 9.
Looking at MARC::Record->encoding() shows that encoding depends on leader even for UNIMARC.
So this patch adds a call to MARC::Record->encoding('UTF-8') in case of a SRU server in C4::Breeding.

Same use exists in Koha::MetadataRecord::Authority::get_from_breeding().

In case of import via Z3950, MarcToUTF8Record() is called,
 which calls SetMarcUnicodeFlag(),
 which calls MARC::Record->encoding('UTF-8')

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 also Authorities import via SRU
13) Check also SRU imports on a MARC21 database

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended: Removed change to new_from_xml call. We should respect syntax.
But the added MARC::Record encoding does the tric! Which is implicit
for Z3950 targets where MarcToUTF8Record does the same.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2020-08-12 11:46:25 +02:00
..
AuthoritiesMarc
Barcodes Bug 21395: Fix C4/Barcodes/ValueBuilder.pm 2020-06-29 15:43:41 +02:00
ClassSortRoutine
ClassSplitRoutine Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Creators Bug 25852: Improve C4::Creators::Lib reliability under plack 2020-07-31 10:03:26 +02:00
External
Form
Heading
ILSDI Bug 24769: (bug 14711 follow-up) Fix typo in parameter name for AddReserve 2020-05-05 11:03:33 +01:00
Installer
Labels Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Linker Bug 25189: Don't create authority if results found 2020-06-24 14:31:37 +02:00
Members Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
OAI
Output
Patroncards Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Reports
Search
Serials
SIP Bug 24165: Add ability to send any item field in a library chosen SIP field 2020-07-20 17:45:31 +02:00
Utils Bug 15400: Display date of birth and age more consistantly 2020-06-29 12:37:02 +02:00
Accounts.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Acquisition.pm Bug 25750: fix fallback to ecost_tax_included/ecost_tax_excluded 2020-07-09 11:50:42 +02:00
Auth.pm Bug 24201: (QA follow-up) Correct call to set_userenv 2020-08-07 16:54:40 +02:00
Auth_cas_servers.yaml.sample
Auth_with_cas.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Auth_with_ldap.pm
Auth_with_shibboleth.pm
AuthoritiesMarc.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
BackgroundJob.pm
Barcodes.pm
Biblio.pm Bug 26133: Remove GetMarcHosts 2020-08-05 17:36:28 +02:00
Boolean.pm
Breeding.pm Bug 23542: Fix SRU import encoding 2020-08-12 11:46:25 +02:00
Budgets.pm
Calendar.pm Bug 25723: (QA follow-up) Handle holiday and exception on same day 2020-07-20 17:45:31 +02:00
Charset.pm
Circulation.pm Bug 26108: Only call the plugin hook if a return took place 2020-07-31 15:04:44 +02:00
ClassSortRoutine.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
ClassSource.pm
ClassSplitRoutine.pm
Context.pm Bug 24201: Attach desk to intranet session 2020-08-07 16:54:40 +02:00
Contract.pm
CourseReserves.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Creators.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Debug.pm
Heading.pm
HoldsQueue.pm Bug 25799: Add edition information to "Holds queue" report 2020-07-20 17:45:31 +02:00
HTML5Media.pm Bug 20783: Use iframe to embed Youtube videos 2020-06-15 10:32:43 +02:00
Images.pm
ImportBatch.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
ImportExportFramework.pm
InstallAuth.pm Bug 21395: (QA follow-up) POD fixes 2020-06-29 12:37:02 +02:00
Installer.pm
ItemCirculationAlertPreference.pm
Items.pm Bug 25964: Prevent data loss when editing items from a MARC record 2020-07-13 11:41:45 -03:00
Koha.pm
Labels.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Languages.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Letters.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Linker.pm
Log.pm
MarcModificationTemplates.pm
Matcher.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Members.pm
Message.pm
NewsChannels.pm
Output.pm Bug 11994: OpenSearch plugins needs to be delivered with Content-Type application/opensearchdescription+xml 2020-06-24 14:31:37 +02:00
Overdues.pm Bug 25127: Use Koha::Number::Price->round for comparison 2020-05-01 15:44:55 +01:00
Patroncards.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Record.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Reports.pm
Reserves.pm Bug 24031: Add plugin hook after_hold_create 2020-07-30 17:30:23 +02:00
Ris.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
RotatingCollections.pm
Scheduler.pm
Scrubber.pm
Search.pm Bug 23086: Search for collection is broken 2020-07-27 17:24:26 +02:00
Serials.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
Service.pm
ShelfBrowser.pm
SMS.pm
SocialData.pm
Stats.pm Bug 24151: Copy info to the pseudonymized table when a transaction is done 2020-07-20 15:17:42 +02:00
Suggestions.pm
Tags.pm
Templates.pm Bug 21395: Make perlcritic happy 2020-06-29 12:37:02 +02:00
TmplToken.pm
TmplTokenType.pm
TTParser.pm Bug 25305: Translation process - Open all files specifying the utf8 encoding 2020-05-04 08:50:07 +01:00
UsageStats.pm Bug 24159: Move useDaysMode pref to circulation rules 2020-06-25 10:51:59 +02:00
XISBN.pm
XSLT.pm