Skip to content

Commit

Permalink
Merge pull request #130 from dathere/129-fix-encoding-echeck
Browse files Browse the repository at this point in the history
Strip encoding result from `uchardet`
  • Loading branch information
jqnatividad authored Jan 24, 2024
2 parents 2c648b2 + 76fcd6e commit c2ba7f0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions datapusher/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,9 @@ def _push_to_datastore(task_id, input, dry_run=False, temp_dir=None):
text=True,
)
logger.info("Identified encoding of the file: {}".format(file_encoding.stdout))

# trim the encoding string
file_encoding.stdout = file_encoding.stdout.strip()

# using iconv to re-encode in UTF-8
if file_encoding.stdout != "UTF-8":
Expand Down

0 comments on commit c2ba7f0

Please sign in to comment.