Koha/misc
Jonathan Druart c121a53dd7
Bug 24123: Fix import of UTF-8 encoded MARC21 MARCXML using bulkmarcimport (elastic only)
If elastic is used as search engine, the bulkmarcimport.pl will not
handle correctly UTF-8 encoded MARCXML

Koha::SearchEngine::Search->new uses a require statement to load the correct Search module.
This is done l.257 of bulkmarcimport.pl:
  257 my $searcher = Koha::SearchEngine::Search->new

Koha::SearchEngine::Elasticsearch::Search will `use MARC::File::XML`, and so resets the arguments set before:
  216     $MARC::File::XML::_load_args{BinaryEncoding} = 'utf-8';

  220     $MARC::File::XML::_load_args{RecordFormat} = $recordformat;

An easy (but dirty) fix could be to move the declaration of my $searcher before in the script.
The tricky (but correct) fix would be to remove the long standing "ugly hack follows" comment.

This patch is the easy, and dirty, fix

Test plan:
Use the command line tool to import MARXCML records that contains unicode characters into Koha

Something like `misc/migration_tools/bulkmarcimport.pl -biblios -file record.marcxml -m=MARCXML`

Without this patch you will notice that unicode characters will not be displayed correctly

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2020-01-10 08:27:47 +00:00
..
admin Bug 23193: Make set_password.pl use Koha::Script 2019-06-28 14:34:13 +01:00
bin
cronjobs Bug 24268: Break assignment and warn into separate actions 2019-12-20 12:06:00 +00:00
devel Bug 23049: Add debit_type 2019-10-24 17:23:48 +01:00
interface_customization Bug 23903: Replace OPAC icons with Font Awesome 2019-10-31 15:40:25 +00:00
load_testing
maintenance Bug 23846: Handle exception gracefully at the OPAC 2019-11-13 08:04:23 +00:00
migration_tools Bug 24123: Fix import of UTF-8 encoded MARC21 MARCXML using bulkmarcimport (elastic only) 2020-01-10 08:27:47 +00:00
release_notes Update release notes for 19.11.00 release 2019-11-28 18:25:06 +00:00
search_tools Bug 22826: Allow indexing of individual authorities in Elasticsearch 2019-10-28 12:45:28 +00:00
translator Bug 24365: (bug 24217 follow-up) Fix encoding issue for translator script 2020-01-07 15:07:31 +00:00
add_date_fields_to_marc_records.pl Bug 22509: (RM follow-up) Add use of Koha::Script base class 2019-06-24 15:08:33 +01:00
batchCompareMARCvsFrameworks.pl Bug 22600: Set 'commandline' interface appropriately 2019-04-10 19:43:11 +00:00
batchdeletebiblios.pl Bug 22600: Set 'commandline' interface appropriately 2019-04-10 19:43:11 +00:00
batchDeleteUnusedSubfields.pl Bug 22600: Set 'commandline' interface appropriately 2019-04-10 19:43:11 +00:00
batchImportMARCWithBiblionumbers.pl Bug 22721: Remove frameworkcode parameter in GetMarcFromKohaField calls 2019-07-15 11:28:08 +01:00
batchRebuildBiblioTables.pl Bug 11529: Simplify and optimize batchRebuildBiblioTables.pl 2019-08-05 15:03:17 +01:00
batchRebuildItemsTables.pl Bug 22721: Remove frameworkcode parameter in GetMarcFromKohaField calls 2019-07-15 11:28:08 +01:00
batchRepairMissingBiblionumbers.pl Bug 22600: Set 'commandline' interface appropriately 2019-04-10 19:43:11 +00:00
check_sysprefs.pl Bug 22600: Set 'commandline' interface appropriately 2019-04-10 19:43:11 +00:00
commit_file.pl Bug 22600: Set 'commandline' interface appropriately 2019-04-10 19:43:11 +00:00
export_borrowers.pl Bug 22600: Set 'commandline' interface appropriately 2019-04-10 19:43:11 +00:00
export_records.pl Bug 20485: Don't account for items timestamps when items not included 2019-05-10 17:22:27 +00:00
exportauth.pl Bug 22600: Set 'commandline' interface appropriately 2019-04-10 19:43:11 +00:00
import_patrons.pl Bug 22875: Document verbose option in import_patrons 2019-05-15 12:10:53 +00:00
koha-install-log Bug 17851: Add Elasticsearch config to koha-conf.xml - Add missing entries to koha-install-log 2019-10-07 14:09:10 +01:00
kohalib.pl
link_bibs_to_authorities.pl Bug 21957: Add a flag to ModBiblio to avoid linking auths if called from linker 2019-04-18 10:02:03 +00:00
mod_zebraqueue.pl Bug 22600: Set 'commandline' interface appropriately 2019-04-10 19:43:11 +00:00
perlmodule_ls.pl
perlmodule_rm.pl
recreateIssueStatistics.pl Bug 22600: Set 'commandline' interface appropriately 2019-04-10 19:43:11 +00:00
sax_parser_print.pl
sax_parser_test.pl
sip_cli_emulator.pl Bug 22540: (QA follow-up) fixes 2019-10-08 14:33:34 +01:00
stage_file.pl Bug 22600: Set 'commandline' interface appropriately 2019-04-10 19:43:11 +00:00
z3950_responder.pl Bug 13937: Add support for Z39.50 responder to the Debian scripts 2019-10-08 14:40:07 +01:00