Fix bug with utf-8 encoding