fix substr utf8 bug