added utf8 encoding option