Enable overloading CharsetReader for different encodings

This exposes a point where an external program can overload the CharsetReader with any function they like. If a function hasn't been set, then we don't override this.

We'll have to set this in other places, but this is the solution for the general problem.