#!/usr/bin/perl use strict vars; use utf8; use encoding 'utf8'; my $e = "Böck"; if (utf8::is_utf8($e)) { print "yep, is UTF8\n"; } # this fails with: Malformed UTF-8 character # seems to require the combination of a minimum-length wildcard match # + non-matching character class. For example: # m/.*?[k]$/ succeeds # m/.*?x$/ succeeds # m/.*[x]$/ succeeds if ($e=~ m/.*?[x]$/) { print "matched\n"; } print "success with $e\n"; #### % ./test.pl yep, is UTF8 Malformed UTF-8 character (fatal) at ./test.pl line 17.