I'm accessing amazons MWS-Api via parse.com (which is build upon nodejs) and have issues with their flatfile-reports (the getreport endpoint). All special characters (ä, ö, ü) are simply removed. According to the MWS-Support, they are using the CP1252-Encoding. Here's the request code.
// Parse.Cloud.httpRequest is parses version of the nodejs http-module
Parse.Cloud.httpRequest({
url: "https://mws.amazonservices.de/?",
method: "POST",
headers: {
"Content-Type": "application/x-www-form-urlencoded; charset=utf-8",
"Host": "mws.amazonservices.de",
"x-amazon-user-agent": "MyUserAgent(Language=Javascript)",
"Accept-Charset": "CP1252"
},
body: queryString
success: function(resp){
response.success(resp)
}
},
error: function(err){
response.error(err)
}
The response-headers I'm receiving look as follows:
{
"Connection": "close",
"Content-Length": "395828",
"Content-MD5": "Xw8KYGqESc7u4TTzgcbT/g==",
"Content-Type": "text",
"Date": "Thu, 13 Aug 2015 10:21:00 GMT",
"Server": "AmazonMWS",
"Vary": "Accept-Encoding,User-Agent",
"x-amz-request-id": "xxxxx",
"x-mws-quota-max": "60.0",
"x-mws-quota-remaining": "58.0",
"x-mws-quota-resetsOn": "2015-08-13T10:38:00.000Z",
"x-mws-request-id": "xxxxx",
"x-mws-response-context": "C0ywPcTe0K9qESsoz4OzZX9oRJMDuYR9vvk5MfN3KKOGEnyWgSZlOQDixINemnwLVZl0DjXEdrY=",
"x-mws-timestamp": "2015-08-13T10:21:01.186Z"
}
To clarify, the special characters are not being garbled (no "�" or anything like it). "Für" is simply received as "Fr".Oddly, I have the same issue with amazons scratchpad (https://mws.amazonservices.de/scratchpad/index.html), which should, according to the MWS-Support, show the special characters properly. Thanks for any help in advance.
edit1: Also, a coworker of mine has a very similar issue with parse, in a completely unrelated project (different data-source n everything). After a bit of experimenting in python, I'm fairly certain his datafeed is encoded in latin1, not utf8, which seems to cause the issue. Any way of enforcing latin1 or CP1252 encoding in parse?
The Amazon support confirmed that it was a bug on their end and, from what I can tell, fixed it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With