lineofflight / peddler

Amazon Selling Partner API (SP-API) in Ruby
https://lineofflight.github.io/peddler/
MIT License
307 stars 130 forks source link

MWS US and DE report api response 'Cp1252' instead of 'ISO-8859-1' #53

Closed wppurking closed 8 years ago

wppurking commented 8 years ago

@hakanensari I see the file marketplace.rb have assign the response encoding to Peddler::Parser like FlatFileParser.

But i found recently amazon (US, DE) has change the report api (flat file) encoding from 'ISO-8859-1' to 'Cp1252' and i found this article

These affect something like this:

s = "™"
s.encoding #>#<Encoding:UTF-8>

s.encode('cp1252') #>"\x99"

s.encode('ISO-8859-1') #>Encoding::UndefinedConversionError: U+2122 from UTF-8 to ISO-8859-1....

So i think we should move ISO-8859-1 to Cp1252. Cp1252 can hold all char in iso-8859-1and some other latin chars.

attach with some response returned with Amazon Scratchpad (I only have US and DE account for amaozn mws, so only test US and DE market) Amazon DE Amazon US

And response header with EXCON_DEBUG=true qq20151225-4

hakanensari commented 8 years ago

I'll bump library version after confirming this is not messing with flat file uploads using the Feeds API.

wppurking commented 8 years ago

:+1: