[core] re-add support for non-unicode encodings

We can't trust clients to use valid unicode. Some of them use arachaic encodincs.
Because this is so, we must support these encodings to prevent exceptions where we can't decode the input to proper unicode.

Sorry about that.