in reply to A definitive way to handle encoding/decoding problems?

There are several resources that can help you. I have written Character Encodings in Perl, and there's also the Perl Programming Unicode/UTF-8 wikibook.

The simplest advice boils down to decoding everything that comes into your program, and encoding everything that leaves your program.

All in all encoding problems are not really different than any other bugs where wrong output is produced. The real problems is that often programmers don't have a clear mental image of how which data source encodes its strings, and what the modules they use do with those strings.

  • Comment on Re: A definitive way to handle encoding/decoding problems?