Before printing a string which comes from the API, sanitize it and remove any control char or ANSI escape sequence.