in reply to Encoding problem

I had a similar problem with a database containing some Latin-1 characters and some UTF-8 characters. I created the CPAN module Encoding::FixLatin to fix this kind of thing. The distribution includes a command line filter that you can pipe a file through.

It won't be able to unravel things that have been double encoded but if you can get back to a raw stream of Latin-1 bytes mixed with UTF-8 bytes then it should convert it all to UTF-8.