dump_all_records_csv: fix UnicodeEncodeError bug