Skip to content

Commit

Permalink
fix readme for encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
ericcj committed Oct 11, 2022
1 parent e7d7bbe commit 653a1ad
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ response = feeds.get_feed(response.feed_id)
result_feed_document_id = response.result_feed_document_id # present once it is successful
response = feeds.get_feed_document(result_feed_document_id)
# GET response.url into compressed, again it's pre-signed so no authorization needed
AmzSpApi.inflate_document(compressed, response)
report = AmzSpApi.inflate_document(compressed, response)
# you should capture the HTTP headers from downloading url as well since it's often Cp1252
report.force_encoding($1) if headers['Content-Type'] =~ /charset *= *([^;]+)/
CSV.parse(report, headers: true, col_sep: "\t", liberal_parsing: true) # if it's a CSV report type
```

## Thanks
Expand Down

0 comments on commit 653a1ad

Please sign in to comment.