added support for UTF-8 encoding