Added support for utf8 encoding