in reply to database stores UTF8 strings inconsistently

your utf8 string loose the utf8 flag. After you get it back from the database. You have to tell that the data from the db is in utf8.
my $same_with_utf8_on = Encode::decode("utf8", $from_db);
Or if you are sure, use
Encode::_utf8_on($from_db);
Boris