Check whether incoming strings are valid UTF-8 sequences. Slows down the string processing slightly and slightly increases code size.