fixed issue with malformed UTF-8 string;

Fixed issue with malformed UTF-8 string
`text[i+1] != 0 ` - this check is not needed too