From 504481faa6976aeec5442710c18025df923ffe59 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Tue, 27 Oct 2020 09:03:16 +0100 Subject: [PATCH] Bug 26832: Make Elasticsearch mappings export use UTF-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Script misc/search_tools/export_elasticsearch_mappings.pl allows to export current search engine configuration into a YAML file. This export should use UTF-8 encoding, like other exports. Test plan : 1) Go to Administration > Search engine configuration (Elasticsearch) 2) Edit a field label to use a diacrtic, for example local-number => Numéro 3) Save 4) Edit file etc/koha-conf.xml to enable 'elasticsearch_index_mappings' 5) Export mappings to file via misc/search_tools/export_elasticsearch_mappings.pl -t $MARCFLAVOUR 6) Reset memcached and plack 7) Back to Administration > Search engine configuration (Elasticsearch) 8) Click on 'Reset Mappings' and accept 9) Look at field 'local-number' => Without patch diacritic 'é' is broken 10) You may try with an emoji B-) Signed-off-by: David Nind Signed-off-by: Martin Renvoize --- misc/search_tools/export_elasticsearch_mappings.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/misc/search_tools/export_elasticsearch_mappings.pl b/misc/search_tools/export_elasticsearch_mappings.pl index 9fd6d78bc0..5d3f49c828 100755 --- a/misc/search_tools/export_elasticsearch_mappings.pl +++ b/misc/search_tools/export_elasticsearch_mappings.pl @@ -80,4 +80,5 @@ if ( $type && $type !~ /^(marc21|unimarc|normarc)$/ ) { my $mappings = Koha::SearchEngine::Elasticsearch::raw_elasticsearch_mappings( $type ); +binmode STDOUT, ":encoding(UTF-8)"; print Dump($mappings); -- 2.20.1