From 8fce3401e75604b36cf0aad2ccb4ce65941e0f55 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 --- t/lib/TestBuilder.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/t/lib/TestBuilder.pm b/t/lib/TestBuilder.pm index 26de949fb3..a39be70866 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