YAML::XS::Dump returns UTF-8 encoded octets, but the value returned by
a renderer gets encoded when the text output is printed, like any other
value. So for properties using the 'yaml' renderer, for example the
account details shown by 'pvenode acme account info', any non-ASCII
character got encoded twice and ended up mangled.
Decode the output of YAML::XS::Dump in the renderer, so it returns a
character string like all other renderers, and add a test for it.
Fixes: 99d0252 ("properly encode YAML via YAML::XS")
Signed-off-by: Michal Fox <me@dualfroz.com>
YAML::XS::Dump already returns UTF-8 encoded octets, but its output
still got encoded once more. This is a leftover from when the YAML
output was generated by CPAN::Meta::YAML, which returns a character
string.
As a result, all non-ASCII characters got mangled with the 'yaml'
output format, for example a cluster description with a German umlaut
when running:
pvesh get /cluster/options --output-format yaml
Print the output of YAML::XS::Dump as is, like it is already done for
the 'json' output format, and add a test for the encoding of both.
Fixes: 99d0252 ("properly encode YAML via YAML::XS")
Signed-off-by: Michal Fox <me@dualfroz.com>