You'll need Iconv to convert from whatever encoding the file is in (most
likely "ISO 8859-2") to UTF-8 first.

Something like this instead of the last line above:

var Iconv = require('iconv').Iconv;
var iconv = new Iconv('latin2', 'utf-8');
stream.pipe(iconv).pipe(csvStream);


On Mon, Feb 6, 2017 at 7:44 AM, Kamil Lewandowski <[email protected]>
wrote:

> Hi
> I'm new on developing in node and i'm stuck with parsing csv file with
> polish symbols. Example using fast-csv with encoding settings utf16le / utf8
> /base64 with "łódź" in source:
> [ '齤਍' ],
> [ '��d�' ],
> [ 's/Nknw0K' ]
>
>
> how should I load file represents texts in Central European
> <https://en.wikipedia.org/wiki/Central_Europe> and Eastern European
> <https://en.wikipedia.org/wiki/Eastern_Europe> languages ??
>
>
> Path i try with fast-csv package
>
> var fs = require('fs');
> var csv = require("fast-csv");
>
> var stream = fs.createReadStream("test2.csv", {
>     encoding: "utf8",
>     header: "true",
>     rowDelimiter:';'
> }
> );
>
> var csvStream = csv()
>     .on("data", function(data){
>          console.log(data);
>     })
>     .on("end", function(){
>          console.log("done");
>     });
>
> stream.pipe(csvStream);
>
> --
> Job board: http://jobs.nodejs.org/
> New group rules: https://gist.github.com/othiym23/9886289#file-
> moderation-policy-md
> Old group rules: https://github.com/joyent/node/wiki/Mailing-List-
> Posting-Guidelines
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/nodejs/71854533-bc26-45d0-8217-18a5bc85d541%40googlegroups.com
> <https://groups.google.com/d/msgid/nodejs/71854533-bc26-45d0-8217-18a5bc85d541%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAPJ5V2azmOi-0iFV1fyOHB7d0sH9D8SrS9zOjpExC1gc_iLUow%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to