Help for this page

Select Code to Download


  1. or download this
    use Encode qw( is_utf8 encode_utf8 );
    
    is_utf8($string) ? encode_utf8($string) : $string
    
  2. or download this
    use Encode qw( encode_utf8 );
    
    ...
    
    my $sth = ...;
    $sth->execute(encode_utf8($decoded));
    
  3. or download this
    use Encode qw( decode );
    
    ...
    
    my $sth = ...;
    $sth->execute(decode('cp1252', $encoded));
    
  4. or download this
    sub _d { my ($s) = @_; utf8::downgrade($_); $s }
    
    ...
    
    my $sth = ...;
    $sth->execute(_d($encoded));