correctly flag invalid utf