koles / ya-csv

CSV parser/writer for Node.js
MIT License
242 stars 55 forks source link

Fix writing CSVs with custom encoding #39

Closed cstigler closed 8 years ago

cstigler commented 9 years ago

On line 305 of ya-csv.js, it writes to the writeStream using this.encoding, but since the function is not invoked on an object, this is the Node global (not the write stream). Therefore this.encoding will probably never be defined.

It should read encoding from writer to properly use custom encodings. This PR fixes that.