Skip to content

Commit 1761da3

Browse files
author
Bhushankumar L
authored
Merge pull request #66 from bhushankumarl/development
Development
2 parents b0ddcc4 + 096ac56 commit 1761da3

File tree

5 files changed

+12
-13
lines changed

5 files changed

+12
-13
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,5 @@ node_modules/
7575
.tmp/*
7676
npm-debug.log
7777
npm-debug.log/*
78-
package-lock.json
78+
package-lock.json
79+
response.txt

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
0.0.23
2+
- Bug Fix for Feed Result charset
3+
14
0.0.22
25
- Bug Fix Default value for XML parsing
36
- Add Support for the Subscription APIs, Recommendations API

examples/javaScript/feeds/getFeedSubmissionResultCharset.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ var accessKey = process.env.AWS_ACCESS_KEY_ID || 'YOUR_KEY';
44
var accessSecret = process.env.AWS_SECRET_ACCESS_KEY || 'YOUR_SECRET';
55

66
var amazonMws = require('../../../lib/amazon-mws')(accessKey, accessSecret);
7-
var fse = require('fs-extra');
87

98
/**
109
* Use __CHARSET__ to override charset option.;
11-
* This along with __RAW__ do not get written in the request.
10+
* This along with __RAW__ do NOT get written in the request.
1211
* */
1312
function feedRequest() {
1413
var FeedSubmissionId = '10101010XXX';
@@ -18,14 +17,14 @@ function feedRequest() {
1817
'SellerId': 'SELLER_ID',
1918
'MWSAuthToken': 'MWS_AUTH_TOKEN',
2019
'FeedSubmissionId': FeedSubmissionId,
21-
__CHARSET__: 'latin1'
20+
// __CHARSET__: 'latin1'
21+
__CHARSET__: 'ISO-8859-1'
2222
}, function (error, response) {
2323
if (error) {
2424
console.log('error ', error);
2525
return;
2626
}
27-
fse.writeFileSync('response.txt', response.data);
28-
console.log('Headers', response.Headers);
27+
console.log('response ', JSON.stringify(response));
2928
});
3029
}
3130

lib/AmazonMwsResource.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,7 @@ AmazonMwsResource.prototype = {
277277
debug('Inside user Charset option');
278278
charset = userOptions.userCharset;
279279
try {
280-
/**
281-
* https://github.com/ashtuchkin/iconv-lite/issues/32
282-
*/
283-
var win1251String = iconv.decode(bufferString, 'win1251');
284-
responseString = iconv.encode(win1251String, charset);
280+
responseString = iconv.decode(bufferString, charset);
285281
} catch (Exception) {
286282
debug('Exception iconv ', Exception);
287283
return callback.call(self, new Error.AmazonMwsAPIError({
@@ -336,7 +332,7 @@ AmazonMwsResource.prototype = {
336332
}
337333
// debug('response', response);
338334
try {
339-
ResponseMetadata = response.ResponseMetadata;
335+
ResponseMetadata = response.ResponseMetadata || {};
340336
} catch (exception) {
341337
debug('exception', exception);
342338
ResponseMetadata = {};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "amazon-mws",
3-
"version": "0.0.22",
3+
"version": "0.0.23",
44
"description": "Amazon MWS API wrapper",
55
"keywords": [
66
"Amazon MWS",

0 commit comments

Comments
 (0)