doop.c AOK Malformed UTF-8 character __END__ # doop.c use utf8 ; $_ = "\x80 \xff" ; chop ; EXPECT Malformed UTF-8 character at - line 4. ######## # doop.c BEGIN { if (ord("\t") == 5) { print "SKIPPED\n# Character codes differ on ebcdic machines."; exit 0; } } use warnings 'utf8' ; use utf8 ; $_ = "\x80 \xff" ; chop ; no warnings 'utf8' ; $_ = "\x80 \xff" ; chop ; EXPECT \x80 will produce malformed UTF-8 character; use \x{80} for that at - line 10. \xff will produce malformed UTF-8 character; use \x{ff} for that at - line 10. Malformed UTF-8 character at - line 11.