# New Ticket Created by Brad Baxter # Please include the string: [perl #58218] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=58218 > -- Perl 5.10.0 documentation -- http://perldoc.perl.org/perluniintro.html#Questions-With-Answers How Do I Detect Data That's Not Valid In a Particular Encoding? Use the Encode package to try converting it. For example, use Encode 'decode_utf8'; eval { decode_utf8($string, Encode::FB_CROAK) }; if ($@) { # $string is valid utf8 } else { # $string is not valid utf8 } Should be use Encode 'decode_utf8'; eval { decode_utf8($string, Encode::FB_CROAK) }; if ($@) { # $string is not valid utf8 } else { # $string is valid utf8 }Thread Next