parsing - Read Arabic lettering in html into csv using Perl -
i working html has arabic lettering in it. trying parse lettering csv file opens default in excel.
i using perl script parse lettering out thought using
use feature 'unicode_strings';
in perl allow csv store arabic lettering not.
is there way round this?
use autodie qw(:all); use web::query qw(wq); use text::csv_xs qw(); $csv = text::csv_xs->new({binary => 1}) or die "cannot use csv: ".text::csv_xs->error_diag; open $fh, '>:encoding(utf-8)', 'm.csv'; $csv->print($fh, [wq( '<!doctype html> <html><head><title></title></head><body>مكة أو مكة المكرمة هي مدينة مقدسة لدى المسلمين، بها المسجد الحرام، والكعبة التي تعد قبلة المسلمين في صلاتهم.</body></html>' )->find('body')->text]); close $fh;
Comments
Post a Comment