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