added utf-8 encoding support