in reply to WriteExcel unicode question

What if you try to read both the files in some variable, while you're opening the files you specify the Greek encoding for them in the open argument?
Something like;
#this is Japanese... my $file = 'unicode_8859_11.txt'; open FH, '<:encoding(iso-2022-jp)', $file or die "$!\n";
I know you are dealing with .csv and .xls but I hope my suggestion can offer some light. Excel files are not easy to handle with the Spreadsheet::WriteExcel because they're tab-delimited, a representation of the tab can trickle in the output, this might be why the excel file is giving you troubles, I'd rather convert the file to .csv or convert both files to .txt so handling them becomes easier and such unexpected behaviors kept in check. Make sure you save a copy of the original file.

In addition check this, they got some links to SpreadSheet examples for dealing with foreign languages in Unicode to the left of the page, it might be of use. I wish you luck...

Another point, using the OLE module is recommended over Spreadsheet::WriteExcel for more reliability working with Excel on Windows. Update after reply from jmcnamara

Update:Added a brief idea about Excel tab-delimiters and also about the OLE module


Excellence is an Endeavor of Persistence. Chance Favors a Prepared Mind.

Replies are listed 'Best First'.
Re^2: WriteExcel unicode question
by jmcnamara (Monsignor) on Oct 15, 2009 at 11:02 UTC

    Another point, using the OLE module is recommended over Spreadsheet::WriteExcel for more reliability working with Windows files.

    "Citation needed".

    AFAIK, there aren't any reliability problems with Spreadsheet::WriteExcel. Also, it doesn't work with "Windows files". It creates an Excel file, which is also a file format used on Mac and Linux, on any platform that Perl works on.

    --
    John.

Re^2: WriteExcel unicode question
by demis (Novice) on Oct 15, 2009 at 10:00 UTC
    Same as the unicode_8859_7.pl script: The "cell" I read from csv is always fine. It's the cell from the excel file that gives me problems. Unless I am missing something and now one can open excel files with the ParseExcel module using ...filehandles???
Re^2: WriteExcel unicode question
by demis (Novice) on Oct 15, 2009 at 10:53 UTC
    This was also what I was thinking about, though I did not want to give up that easily: Convert the xls file to csv. I still do not understand why although INTERNALLY the computer looks at two strings and sees them as equal, then come printing, one prints fine and the other as junk.