enh(sccm): sites-status mode - better encoding management (#3074)

This commit is contained in:
qgarnier 2021-09-02 10:24:45 +02:00 committed by GitHub
parent a71bcabdf4
commit 0c05cb0e7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -158,10 +158,10 @@ sub manage_selection {
$self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1);
$self->{output}->exit();
}
my $decoded;
eval {
$decoded = JSON::XS->new->utf8->decode($stdout);
$decoded = JSON::XS->new->decode($self->{output}->decode($stdout));
};
if ($@) {
$self->{output}->add_option_msg(short_msg => "Cannot decode json response: $@");