fix bug with utf-16 encoding