Added support for more character encodings.