in reply to Fixing utf8 errors

It's because printing wide characters causes Perl to try to encode them into bytes (maybe through an :encoding(...) IOLayer). When you pass a character which cannot be represented in target encoding, an exception is raised. You can also try encode with different error handling modes (your current one is similar to FB_CROAK).

Did I guess the error message ($@) you receive correctly? If not, please provide an example.