#!/usr/bin/env perl BEGIN { binmode STDOUT, ':encoding(utf-8)'; } use strict; use warnings; use utf8; use HTML::Entities; my $input = "Håppy"; print "Input was: $input\n"; my $native = decode_entities($input); print "Decoded to native format: $native\n"; if ($native =~ m/å/) { print "Found an å.\n"; } #### Input was: Håppy Decoded to native format: Håppy Found an å.