Support non-UTF8 charsets