Balakumar
Balakumar

Reputation: 650

Spanish character in CSV using Perl file handling

I am using Perl Mechanize to store content from a Spanish language site and saving it in a csv file.

But the data's are not store as i expected.

For Example ::España , México , Dejó de publicarse

But i need to save it as España, México ,Dejó de publicarse

Need some guidance,Thanks in Advance

Upvotes: 1

Views: 418

Answers (1)

daxim
daxim

Reputation: 39158

See http://p3rl.org/UNI

use autodie qw(:all);
open my $fh, '>> :encoding(UTF-8)', 'output.csv';
print {$fh} qq|"$Name,$location"\n|;
close $fh;

Upvotes: 1

Related Questions