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;
|