bug fix: removes any string character encodings which are invalid