From: Dietmar Maurer Date: Tue, 2 May 2017 09:09:35 +0000 (+0200) Subject: use Encode::Locale to encode parameters read from console(getopt) X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=24197a9f6c698985b7255fbf7792b0b6bd8188b5 use Encode::Locale to encode parameters read from console(getopt) --- 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}) {