I'm not entirely certain what's happening here as there are a few missing pieces of the puzzle. Is your table's encoding set as UTF-8? Also, when you say "the output of your script is OK", do you mean the Data::Dumper output? And have done a SELECT directly against the database table to see if the data is being store in the format you're expecting?
If you want to understand more about handling Unicode, my book is temporarily online for free and Chapter 9 contains a Unicode section which, while incomplete (it would take an entire book of its own), does explain the basics of Perl's Unicode handling well enough for you to debug most problems.