Bug 24827: Standardise on 'UTF-8' as the encoding name
authorAndreas Roussos <a.roussos@dataly.gr>
Sun, 15 Mar 2020 07:34:52 +0000 (08:34 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 16 Mar 2020 14:45:39 +0000 (14:45 +0000)
This patch standardises the encoding name used in direct calls
to new_from_xml() to 'UTF-8' instead of 'utf8' or 'utf-8'.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

C4/Biblio.pm
Koha/Biblio/Metadata.pm
misc/batchRebuildBiblioTables.pl
misc/migration_tools/build_oai_sets.pl
opac/opac-readingrecord.pl
svc/bib
svc/import_bib
svc/new_bib

index f745b93..60bdc89 100644 (file)
@@ -1158,7 +1158,7 @@ sub GetMarcBiblio {
 
     if ($marcxml) {
         $record = eval {
-            MARC::Record::new_from_xml( $marcxml, "utf8",
+            MARC::Record::new_from_xml( $marcxml, "UTF-8",
                 C4::Context->preference('marcflavour') );
         };
         if ($@) { warn " problem with :$biblionumber : $@ \n$marcxml"; }
index bdc1435..b43a04b 100644 (file)
@@ -67,7 +67,7 @@ sub record {
     my $record;
 
     if ( $self->format eq 'marcxml' ) {
-        $record = eval { MARC::Record::new_from_xml( $self->metadata, 'utf-8', $self->schema ); };
+        $record = eval { MARC::Record::new_from_xml( $self->metadata, 'UTF-8', $self->schema ); };
         my $marcxml_error = $@;
         chomp $marcxml_error;
         unless ($record) {
index 15f6503..edc7c16 100755 (executable)
@@ -63,7 +63,7 @@ while (my ($biblionumber, $frameworkcode) = $sth->fetchrow) {
 
     $marcxml = C4::Charset::StripNonXmlChars( $marcxml );
     my $record = eval {
-        MARC::Record::new_from_xml($marcxml, 'utf8', $marcflavour);
+        MARC::Record::new_from_xml($marcxml, 'UTF-8', $marcflavour);
     };
     if ($@) {
         push @errors, $biblionumber;
index a19cc4c..64addad 100755 (executable)
@@ -121,7 +121,7 @@ foreach my $res (@$results) {
     MARC::File::XML->default_record_format(C4::Context->preference('marcflavour'));
     my $record;
     eval {
-        $record = MARC::Record::new_from_xml($marcxml, "utf8", C4::Context->preference('marcflavour'));
+        $record = MARC::Record::new_from_xml($marcxml, "UTF-8", C4::Context->preference('marcflavour'));
     };
     if($@) {
         warn "(biblio $biblionumber) Error while creating record from marcxml: $@";
index 0e7a33a..c13faac 100755 (executable)
@@ -97,7 +97,7 @@ foreach my $issue ( @{$issues} ) {
     if ( $marcxml ) {
         $marcxml = StripNonXmlChars( $marcxml );
         my $marc_rec =
-          MARC::Record::new_from_xml( $marcxml, 'utf8',
+          MARC::Record::new_from_xml( $marcxml, 'UTF-8',
             C4::Context->preference('marcflavour') );
         $issue->{normalized_upc} = GetNormalizedUPC( $marc_rec, C4::Context->preference('marcflavour') );
     }
diff --git a/svc/bib b/svc/bib
index 50580e8..11cc260 100755 (executable)
--- a/svc/bib
+++ b/svc/bib
@@ -90,7 +90,7 @@ sub update_bib {
     my $inxml = $query->param('POSTDATA');
     print $query->header(-type => 'text/xml', -charset => 'utf-8');
 
-    my $record = eval {MARC::Record::new_from_xml( $inxml, "utf8", C4::Context->preference('marcflavour'))};
+    my $record = eval {MARC::Record::new_from_xml( $inxml, "UTF-8", C4::Context->preference('marcflavour'))};
     my $do_not_escape = 0;
     if ($@) {
         $result->{'status'} = "failed";
index 8577036..3073463 100755 (executable)
@@ -73,7 +73,7 @@ sub import_bib {
     }
 
     my $marcflavour = C4::Context->preference('marcflavour') || 'MARC21';
-    my $marc_record = eval {MARC::Record::new_from_xml( $inxml, "utf8", $marcflavour)};
+    my $marc_record = eval {MARC::Record::new_from_xml( $inxml, "UTF-8", $marcflavour)};
     if ($@) {
         $result->{'status'} = "failed";
         $result->{'error'} = $@;
index d9586dd..c41d298 100755 (executable)
@@ -54,7 +54,7 @@ sub add_bib {
     print $query->header(-type => 'text/xml', -charset => 'utf-8');
 
     my $marcflavour = C4::Context->preference('marcflavour') || 'MARC21';
-    my $record = eval {MARC::Record::new_from_xml( $inxml, "utf8", $marcflavour)};
+    my $record = eval {MARC::Record::new_from_xml( $inxml, "UTF-8", $marcflavour)};
     my $do_not_escape = 0;
     if ($@) {
         $result->{'status'} = "failed";