1 2 3 4 5 6 7 8 9 10 11 12
my $contains_term = 0; eval { use HTML::HTML5::Entities; use Encode qw/decode encode/; $terms = decode('UTF-8',$terms); # in Perls interne Zeichenkette $contents = decode('UTF-8',$contents); # in Perls interne Zeichenkette $contents = HTML::HTML5::Entities::decode($contents); # HTML Entities dekodieren $contains_term = ($contents =~ /$terms/); # Matcht es? };
QuoteHTML::Entities - decode_entities() erzeugt kein Unicode sondern Latin1