Fixed a bug with utf8 encoding