Make sure invalid Char isn't written into datafile