fixed issue with malformed UTF-8 string;

Fixed issue with malformed UTF-8 string
`text[i+1] != 0` - this check is not needed, it will always be true because