From 8da6f9ec7713af4ac02629488f6e8a4c018472dc Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Thu, 10 Aug 2017 08:56:19 +0200 Subject: [PATCH] new helper decode_to_html() --- PMG/Utils.pm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/PMG/Utils.pm b/PMG/Utils.pm index 4b5b80d..3386d88 100644 --- a/PMG/Utils.pm +++ b/PMG/Utils.pm @@ -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) = @_; -- 2.39.2