in reply to Re: Parsing UTF-8 characters
in thread Parsing UTF-8 characters

Thank you, your example helped tremendously. The program now works exactly like I need. Thanks again.

Replies are listed 'Best First'.
Re^3: Parsing UTF-8 characters
by Jim (Curate) on Oct 15, 2010 at 00:51 UTC

    Hopefully you took my advice to use Text::CSV instead of a regular expression pattern to parse the UTF-8 CSV records. The following script neatly parses the example record in your original post.

    #!perl use strict; use warnings; use Text::CSV; my $csv = Text::CSV->new({ auto_diag => 1, binary => 1 }); my $file = shift; open my $fh, '<:encoding(UTF-8)', $file; binmode STDOUT, ':encoding(UTF-8)'; my ($field1, $field2, $field3); $csv->bind_columns(\($field1, $field2, $field3)); while ($csv->getline($fh)) { print "$field1\n"; print "$field2\n"; print "$field3\n"; } exit 0;