Replace control characters in input data