fix #3795: filter invalid character references during import