X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=blobdiff_plain;f=data%2FPVE%2FTools.pm;h=dc4bbfd33f7269739dfe5ff18fe99a9098acbbdc;hp=72494027a1e937b310c1fe7515d6e10f93d8d81b;hb=815b2abaea85542a510075de84a155bda3027550;hpb=ded47a6108fb9852749d68d57261415d085a8195 diff --git a/data/PVE/Tools.pm b/data/PVE/Tools.pm index 7249402..dc4bbfd 100644 --- a/data/PVE/Tools.pm +++ b/data/PVE/Tools.pm @@ -727,6 +727,16 @@ sub decode_text { return Encode::decode("utf8", uri_unescape($data)); } +sub decode_utf8_parameters { + my ($param) = @_; + + foreach my $p (qw(comment description firstname lastname)) { + $param->{$p} = decode('utf8', $param->{$p}) if $param->{$p}; + } + + return $param; +} + sub random_ether_addr { my $rand = Digest::SHA1::sha1_hex(rand(), time());