From 86827a82999db56a9784fddab11ea1c2d3fd9e0e 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 --- C4/Installer.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/C4/Installer.pm b/C4/Installer.pm index d8d30319db..ad2fe3e33c 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; @@ -737,6 +737,7 @@ sub update { }; close $outfh; + $out = decode('UTF-8', $out); my $db_entry = { bug_number => $db_rev->{bug_number}, -- 2.20.1