Bugzilla – Attachment 151636 Details for
Bug 33404
Authorities imported from Z39.50 in encodings other than UTF-8 are corrupted
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33404: Alternative approach
Bug-33404-Alternative-approach.patch (text/plain), 2.23 KB, created by
Marcel de Rooy
on 2023-05-24 14:58:55 UTC
(
hide
)
Description:
Bug 33404: Alternative approach
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-05-24 14:58:55 UTC
Size:
2.23 KB
patch
obsolete
>From 40ca640287f39185b023be03be923d17c565756d Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 24 May 2023 14:57:46 +0000 >Subject: [PATCH] Bug 33404: Alternative approach >Content-Type: text/plain; charset=utf-8 > >Work in progress >--- > C4/Breeding.pm | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > >diff --git a/C4/Breeding.pm b/C4/Breeding.pm >index efc9029f48..7a27575357 100644 >--- a/C4/Breeding.pm >+++ b/C4/Breeding.pm >@@ -478,9 +478,6 @@ sub ImportBreedingAuth { > > my $controlnumber = $marcrecord->field('001')->data; > >- # Normalize the record so it doesn't have separated diacritics >- SetUTF8Flag($marcrecord); >- > $searchbreeding->execute($controlnumber,$heading); > my ($breedingid) = $searchbreeding->fetchrow; > >@@ -588,6 +585,13 @@ sub Z3950SearchAuth { > $marcrecord->encoding('UTF-8'); > } else { > ( $marcrecord, $charset_result, $charset_errors ) = MarcToUTF8Record( $marcdata, $marc_type, $encoding[$k] ); >+ if( !@$charset_errors ) { >+ $marcrecord->encoding('UTF-8'); >+ SetUTF8Flag($marcrecord); >+ } else { >+ require Data::Dumper; warn Data::Dumper::Dumper( 'Z3950SearchAuth conversion error', $charset_result, $charset_errors ); >+ next; # skip this one >+ } > } > my $heading; > my $heading_authtype_code; >@@ -596,7 +600,8 @@ sub Z3950SearchAuth { > > $heading = GetAuthorizedHeading({ record => $marcrecord }); > >- my $breedingid = ImportBreedingAuth( $marcrecord, $serverhost[$k], $encoding[$k], $heading ); >+ my $breedingid = ImportBreedingAuth( $marcrecord, $serverhost[$k], 'UTF-8', $heading ); >+ > my %row_data; > $row_data{server} = $servers[$k]->{'servername'}; > $row_data{breedingid} = $breedingid; >-- >2.30.2
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 33404
:
151510
|
151624
|
151636
|
151641
|
151644
|
151672
|
151673
|
151674
|
151868
|
151869
|
151870
|
153014
|
153015
|
153016