The reionization of carbon