kenahoo / Perl-Parse-CSV

Highly flexible CSV parser for large files
0 stars 4 forks source link

Bugs Text::CSV & Parse::CSV -> does not parse quotation marks, special UTF8 characters. #5

Open Catadanna opened 6 years ago

Catadanna commented 6 years ago

Hallo,

I use Perl version 5.22.1 and I work on Windows. I tried to parse a csv file with Text::CSV, it does not parse UTF-8 characters as umlaut in German (ü or ä). I had to open the file with encoding 'ISO-8859-1' and it worked.

open my $fhc,'<:encoding(ISO-8859-1)', $path.$input_content or die "Can't open the INPUT file\n".$input_content."\n: $!";

If I do not specify the encoding I have errors indicating the umlaut characters are not recognized and cannot be parsed. On the other hand, Text::CSV gave errors in Linux environement when inputing a file with quotation marks around the CSV fields. It seems a little odd to me that an input file encoded in UTF-8 could not be parsed correctly.

I am about to try Parse::CSV, and using the following documentation : http://search.cpan.org/~kwilliams/Parse-CSV-2.04/lib/Parse/CSV.pm

It is not very clear how to extract a field, in fetch for example.

Thank you,

Catalina