Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UTF-8 characters from marketo are improperly decoded #74 #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abrittis
Copy link

Steps to reproduce

  • Extract records from marketo that contain UTF-8 characters
  • View results in an editor that supports UTF-8

Expected Results

  • UTF-8 characters are displayed properly

Actual Results

  • UTF-8 characters are corrupted

Proposed Solution

  • IMO this is actually a bug with the Marketo API call https://.mktorest.com/bulk/v1//export/<job_id>/file.json
  • The above call returns a response with the encoding set to ISO-8859-1, even if the response contains UTF-8 characters.
  • This causes Python's requests.models.iter_content(decode_unicode=True) to use the incorrect decoder. (Since the response says the encoding is IOS-8859-1, python just ignores the decode_unicode parameter).
  • My proposed fix would be to set the encoding to 'utf-8' in the response before we request python to iter_content. This change would be in tap-marketo.sync.py right after we make the call "resp = client.stream_export(stream_type, export_id)."

Rollback steps

  • revert this branch

@cmerrick
Copy link
Contributor

Hi @abrittis, thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes.

@cmerrick
Copy link
Contributor

You did it @abrittis!

Thank you for signing the Singer Contribution License Agreement.

@vadim82
Copy link

vadim82 commented Sep 16, 2021

Are there any plans to merge this pull request? We are running into a similar issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants