Anomalies, characters and strings