]> git.proxmox.com Git - pmg-api.git/commitdiff
new helper decode_to_html()
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 10 Aug 2017 06:56:19 +0000 (08:56 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 10 Aug 2017 06:56:19 +0000 (08:56 +0200)
PMG/Utils.pm

index 4b5b80db53d80a60f69c45769832ba77ba0fe2bc..3386d8868e1e2a87518edb44c2bd6b3cab3ccf13 100644 (file)
@@ -856,6 +856,16 @@ sub create_rrd_data {
     return $res;
 }
 
+sub decode_to_html {
+    my ($charset, $data) = @_;
+
+    my $res = $data;
+
+    eval { $res = encode_entities(decode($charset, $data)); };
+
+    return $res;
+}
+
 sub decode_rfc1522 {
     my ($enc) = @_;