replacing newlines before nuking control chars