From a9dd867c809642dcd42c6c8d8e5c4b0f81bcbd25 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 27 Apr 2021 08:24:57 -0300 Subject: [PATCH] Bug 28234: TestBuilder->build_sample_biblio should set UTF-8 encoding for record This patch makes the build_sample_biblio method, correctly set the UTF-8 flag for the MARC::Record object. Tests are added. To test: 1. Apply the regression tests patch 2. Run: $ kshell k$ prove t/db_dependent/TestBuilder.t FAIL: Tests fail! An unexpected encoding warning shows 3. Apply this patch 4. Repeat 2 => SUCCESS: No warning! Tests pass! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart (cherry picked from commit 8fce3401e75604b36cf0aad2ccb4ce65941e0f55) Signed-off-by: Fridolin Somers (cherry picked from commit af4c23186bc3f205b4f3d0f2bcde0ab13daac370) Signed-off-by: Andrew Fuerste-Henry --- t/lib/TestBuilder.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/t/lib/TestBuilder.pm b/t/lib/TestBuilder.pm index 3feac1c9ae..a51e29a4ad 100644 --- a/t/lib/TestBuilder.pm +++ b/t/lib/TestBuilder.pm @@ -155,6 +155,8 @@ sub build_sample_biblio { my $marcflavour = C4::Context->preference('marcflavour'); my $record = MARC::Record->new(); + $record->encoding( 'UTF-8' ); + my ( $tag, $subfield ) = $marcflavour eq 'UNIMARC' ? ( 200, 'a' ) : ( 245, 'a' ); $record->append_fields( MARC::Field->new( $tag, ' ', ' ', $subfield => $title ), -- 2.39.5