$ perl -MDevel::Peek -we'my $buf = "\x80"; open my $fh, "<:utf8", \$buf or die; my $x = <$fh>; Dump $x;' utf8 "\x80" does not map to Unicode at -e line 1, <$fh> line 1. SV = PV(0x814fbb4) at 0x814f6cc REFCNT = 1 FLAGS = (PADBUSY,PADMY,POK,pPOK,UTF8) PV = 0x8170a78 "\200"\0Malformed UTF-8 character (unexpected continuation byte 0x80, with no preceding start byte) in subroutine entry at -e line 1, <$fh> line 1. [UTF8 "\x{0}"] CUR = 1 LEN = 80 #### $ perl -MDevel::Peek -we'my $buf = "\x80"; open my $fh, "<:encoding(UTF-8)", \$buf or die; my $x = <$fh>; Dump $x;' utf8 "\x80" does not map to Unicode at -e line 1. SV = PV(0x814fbb4) at 0x814f6cc REFCNT = 1 FLAGS = (PADBUSY,PADMY,POK,pPOK,UTF8) PV = 0x8197048 "\\x80"\0 [UTF8 "\\x80"] CUR = 4 LEN = 80