forecho / amazon-mws

Interaction with the Amazon api for vendors called MWS
23 stars 15 forks source link

Feed XML requires UTF-8 Encoding #4

Open mfrederico opened 4 years ago

mfrederico commented 4 years ago

Kept getting my feed submissions cancelled and spent the past 4 days troubleshooting everything. It came down to changing my xml header to be:

<?xml version="1.0" encoding="UTF-8"?>

Made all the difference in the world

mfrederico commented 4 years ago

In arrayToXml: return ArrayToXml::convert($array, $customRoot,true,'UTF-8');

stefnats commented 4 years ago

Is this the actual file that you submit? If so, this lib / mws in general is just the way to transport the file. The actual data doesn't get verified with this api & lib.

mfrederico commented 4 years ago

Is this the actual file that you submit? If so, this lib / mws in general is just the way to transport the file. The actual data doesn't get verified with this api & lib.

No, I'm sending XML of feed data. Amazon required my feed data to be UTF-8 formatted, but this library defaults it to ISO-8859-1 which was causing my feeds to be cancelled for days. The fix to the ArrayToXml::convert line made all the difference in my feeds going through.