# Instead of: $sth->execute(@data); # use: use Encode; $sth->execute(map { Encode::encode('utf8', $_) } @data); # and in place of: my @row = $sth->fetchrow; # use: my @row = map { Encode::decode('utf8', $_) } $sth->fetchrow;