fix substring multibyte character may cause garbled text