Configurable encoding

I have added configureable encodings to support, for example, UTF-8