Help for this page

Select Code to Download


  1. or download this
    my $utf8;
    { local $^W; # warnings are thrown when unpacking
    ...
    deal_with_malformed_utf8()
      if length $utf8 == 0 and length $raw != 0;
    
  2. or download this
    use Encode;
    my $string = decode_utf8($bytes);
    ...
    utf8::decode($string = $bytes)  # of course, you can just
      or deal_with_malformed_utf8();# use one variable, and not
                                    # keep the raw bytes.