- async def check_for_mojibake(row, found_mojibake, database, table, has_pri_key=False):
- for column, data in row.items():
- if data is None or not column.startswith("HEX"):
- continue
- for hex_char in data[::2]:
- if hex_char > '7':
- break
- else:
- continue
- field_bytes = binascii.unhexlify(data)
- try:
- field_bytes.decode("utf-8")
- if not has_pri_key:
- log_keyless_table(database, table)
- raise ValueError
- found_mojibake[database][table][rm_hex_wrap(column)]["rows_found"] += 1
- except UnicodeDecodeError:
- pass