Perhaps you want Class::DBI::utf8 (which attempts to Do The Right Thing)? Even if you do not need the Class::DBI structure, you should be able to find what you need in the source. Extracting wildly:
if (defined $string)
{
utf8::upgrade($string);
Encode::_utf8_on($string);
Encode::_utf8_off($string) if (!utf8::valid($string));
}
The intelligent reader will judge for himself. Without examining the facts fully and fairly, there is no way of knowing whether vox populi is really vox dei, or merely vox asinorum. — Cyrus H. Gordon