Encoding debug messages to user defined charset