Fixed charset lookup, tests passing