use Encode qw( encode_utf8 ); $dbh->do("SET NAMES utf8"); my $sth = ...; $sth->execute(encode_utf8($decoded));