Help for this page

Select Code to Download


  1. or download this
    use Encode qw(is_utf8);
    # check if $str is UTF8 and contains bad UTF8.
    print "bad UTF8\n" 
        if is_utf8($str) and not is_utf8($str, 1);
    
  2. or download this
    iconv -c --from UTF-8 --to UTF-8
    
  3. or download this
    use Text::Iconv;
    my $conv = Text::Iconv->new("utf8", "utf8");
    $str = $conv->convert($str);