Bug 24272: Correctly encode output to prevent 'Wide character in say'

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 67b1b20e33)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3fd8e4a13c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
(cherry picked from commit fb5974f788)
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
This commit is contained in:
Jonathan Druart 2021-01-20 10:02:45 +01:00 committed by Victor Grousset/tuxayo
parent a3be3fcce9
commit 1341493bb7
1 changed files with 2 additions and 1 deletions

View File

@ -18,6 +18,7 @@
use Modern::Perl;
use Getopt::Long;
use Pod::Usage;
use Encode qw( encode_utf8 );
use Koha::Script;
use Koha::Caches;
@ -54,6 +55,6 @@ while (my $pref = $prefs->next) {
my $var = lc $pref->variable;
my $cached_var = $syspref_cache->get_from_cache("syspref_$var");
next unless defined $cached_var; #If not defined in cache we will fetch from DB so this case is OK
say sprintf( "%s: value in cache is '%s' and value in db is '%s'", $var, $cached_var, $pref->value )
say encode_utf8( sprintf( "%s: value in cache is '%s' and value in db is '%s'", $var, $cached_var, $pref->value ) )
unless $cached_var eq $pref->value;
}