Encoding is now configurable. (UTF-8 is default)

Made encoding configurable with UTF-8 as default encoding.