Add some more robust bad character handling to the tnt import