Welcome to the Monastery | |
PerlMonks |
UTF8 support for CSV, PDF formatsby vishi83 (Pilgrim) |
on Jan 06, 2012 at 11:54 UTC ( [id://946586]=perlquestion: print w/replies, xml ) | Need Help?? |
vishi83 has asked for the wisdom of the Perl Monks concerning the following question:
Hello great minds, I'm facing issues in writing unicode characters from a data file to CSV or PDF formats in perl. The concept i'm trying with perl is, I've a file which has non-english characters.. For example, i'm using japanese characters. I"m trying to write these japanese characters to various formats. I was able to view this file as html in browser or as excel. All i had to do is to support by application with charset: utf-8 encoding. But to create a CSV or a PDF file, i'm writing this japanese content using file open(). Here, i tried the below way, open (FILE, ">:encoding(UTF-8)", 'output.csv'); (or) open (FILE, ">:encoding(UTF-8)", 'output.pdf'); i also tried, binmode(FH, ":utf8"); i also tried using, Text::CSV->new( { encoding => "utf8" } ) In any of these methods, i'm able to see the output in notepad or browser.. but when i open the CSV file in the excel, i don't see the japanese characters properly From your expertise, can you please suggest me how to go about this and provide some ideas, pls? Thanks....
Back to
Seekers of Perl Wisdom
|
|