fix bug when working with Unicode.