added support for other encodings, closes issue #6