From 25dda58f044fef361106a553490a4c357e268746 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Thu, 8 Jul 2021 16:01:41 +0200 Subject: [PATCH] Bug 25078: Fix encoding issue with db_revs output From `perldoc -f open`: The scalars for in-memory files are treated as octet strings: unless the file is being opened with truncation the scalar may not contain any code points over 0xFF. So $out need to be decoded first in order to be used in other Perl strings Signed-off-by: Kyle M Hall Signed-off-by: Jonathan Druart --- C4/Installer.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/C4/Installer.pm b/C4/Installer.pm index d741992ad1..0fb9ba8f8e 100644 --- a/C4/Installer.pm +++ b/C4/Installer.pm @@ -20,7 +20,7 @@ package C4::Installer; use Modern::Perl; use Try::Tiny; -use Encode qw( encode is_utf8 ); +use Encode qw( encode decode is_utf8 ); use DBIx::RunSQL; use YAML::XS; use C4::Context; @@ -744,6 +744,7 @@ sub update { }; close $outfh; + $out = decode('UTF-8', $out); my $db_entry = { bug_number => $db_rev->{bug_number}, -- 2.39.5