From 24197a9f6c698985b7255fbf7792b0b6bd8188b5 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Tue, 2 May 2017 11:09:35 +0200 Subject: [PATCH] use Encode::Locale to encode parameters read from console(getopt) --- src/PVE/JSONSchema.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/PVE/JSONSchema.pm b/src/PVE/JSONSchema.pm index 936c3cf..9c624f6 100644 --- a/src/PVE/JSONSchema.pm +++ b/src/PVE/JSONSchema.pm @@ -4,6 +4,8 @@ use strict; use warnings; use Storable; # for dclone use Getopt::Long; +use Encode::Locale; +use Encode; use Devel::Cycle -quiet; # todo: remove? use PVE::Tools qw(split_list $IPV6RE $IPV4RE); use PVE::Exception qw(raise); @@ -1349,7 +1351,9 @@ sub get_options { } } - $opts = PVE::Tools::decode_utf8_parameters($opts); + foreach my $p (keys %$opts) { + $opts->{$p} = decode('locale', $opts->{$p}); + } foreach my $p (keys %$opts) { if (my $pd = $schema->{properties}->{$p}) { -- 2.39.2