#! /opt/perls/perls/perl-5.38.2/bin/perl use strict; use warnings; use 5.038; use utf8; use CGI::Carp qw( fatalsToBrowser ); use CGI; use HTML::Restrict; my $html = do { local $/; }; my $cgi = CGI->new(); my $hr = HTML::Restrict->new( rules => { a => [ qw( href title ) ], img => [ qw( src alt ) ], }); my $processed = $hr->process($html); binmode(STDOUT,':utf8'); say $cgi->header({ -type => 'text/html', -charset => 'UTF-8', }), $processed; __DATA__ ÄÖÜẞ ÄÖÜẞ ÄÖÜẞ