use feature 'say'; binmode STDOUT, 'encoding(utf-8)'; my $str = "\xFC\x90\x80\x80\x80\x80"; my $ok = utf8::decode( $str ); say $ok ? 'ok' : 'not ok'; say $str; #### ok Code point 0x10000000 is not Unicode, may not be portable at demo.pl line 8. "\x{10000000}" does not map to utf8 at demo.pl line 8. \x{10000000} #### my $ok = utf8::decode($json); Dump( $json );