Support custom encodings (UTF-8, UTF-16, etc)