On further review, this doesn't look like the codec's responsibility.

The codec is converting "messy" external encoding to a clean internal encoding.

So the codec should expose its internal charset, then have calling code do something like `message.charset = codec.charset` instead of `codec.set_charset_on message`.