properly format 999 detail on bad characters