From 85fa9e4e174e0458860cb54535381f9c02a76229 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 --- 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.20.1