diff --git a/src/PVE/APIServer/Formatter/Standard.pm b/src/PVE/APIServer/Formatter/Standard.pm index c4def16..df864af 100644 --- a/src/PVE/APIServer/Formatter/Standard.pm +++ b/src/PVE/APIServer/Formatter/Standard.pm @@ -8,6 +8,7 @@ use HTTP::Status; use JSON; use HTML::Entities; use PVE::JSONSchema; +use Encode qw/decode/; # register result formatters @@ -56,7 +57,7 @@ PVE::APIServer::Formatter::register_formatter('json', sub { prepare_response_data('json', $res); my $raw = to_json($res->{data}, {utf8 => 1, allow_nonref => 1}); - + $raw = decode('UTF-8', $raw, Encode::FB_DEFAULT); return ($raw, $ct, $nocomp); }); @@ -71,7 +72,7 @@ PVE::APIServer::Formatter::register_formatter('extjs', sub { prepare_response_data('extjs', $res); my $raw = to_json($res->{data}, {utf8 => 1, allow_nonref => 1}); - + $raw = decode('UTF-8', $raw, Encode::FB_DEFAULT); return ($raw, $ct, $nocomp); }); @@ -87,7 +88,7 @@ PVE::APIServer::Formatter::register_formatter('htmljs', sub { prepare_response_data('htmljs', $res); my $raw = encode_entities(to_json($res->{data}, {allow_nonref => 1})); - + $raw = decode('UTF-8', $raw, Encode::FB_DEFAULT); return ($raw, $ct, $nocomp); });