staeco / gtfs-stream

Streaming GTFS and GTFS-RT parser for node
MIT License
30 stars 6 forks source link

Byte order mark gets added to object keys #2

Closed linusnorton closed 5 years ago

linusnorton commented 5 years ago

Unfortunately some feeds (e.g. French bus) have a byte order mark at the beginning of each file and this gets attached to the object key for each row.

For example, instead of the key for trips starting with route_id, it starts with %EF%BB%BFroute_id. To make matters worse %EF%BB%BF is not actually displayed when you console.log making it quite difficult to detect. The only give away is that the route_id is quoted as 'route_id' unlike the other properties.

If you wouldn't mind running strip-bom on the contents of each file just to make sure this doesn't happen I would be very grateful.

yocontra commented 5 years ago

@linusnorton Nice catch, will push a release today and add a test case.

yocontra commented 5 years ago

Was hasty with that fix ^ but follow-up commit finishes it, and published as 1.1.1

linusnorton commented 5 years ago

@contra I think you may need to run npm build before you publish as the code in npm doesn't have the fix

yocontra commented 5 years ago

@linusnorton Sorry, I forgot this repo had a build step. Publishing as 1.1.2

linusnorton commented 5 years ago

All good now, thanks