in reply to Re^5: Slovenian characters problem
in thread Slovenian characters problem
The first call $SheetOut->write(0,0,"Čč") produces the correct writeout in Excel xls table.
In my script I open a simple Excel table and read its line where the same "Čč" characters are written, then I write them into Excel xls table:
push(@Test,{Col1=>$Sheet->Cells(1,1)->{'Value'}}) $SheetOut->write(1,0,encode("cp1250",$Test[0]->{Col1}));
Add 1: As a result the script writes the following characters into output table: "Čč" become "بو", "" and "" become four outlined squares. The characters are therefore completely different, I should perform REPLACE manually in Excel (which is out of question: doing that writing script would have no sense). They become question marks only in case if I skip the use encoding "cp1250".
Add 2: In debugger I see @Test[0]->{Col1} which contains the correct characters "Čč". Data is read from a simple xls Excel table. The next step is writing into another xls Excel table (using Spreadsheet::WriteExcel. The script does nothing to @Test before writing it into table.
I was curious what happens if I add the following four lines:
1 $String="Čč"; 2 $Test2[0]->{Col1}="Čč"; ... 3 $SheetOut->write(2,0,$String); 4 $SheetOut->write(3,0,$Test2[0]->{Col1});
The result of all additional lines from 1 to 4 in the output Excel table are correct written characters!
So it seems to me that the only problem occurs by reading Slovenian characters from Excel table (via Win32::OLE). Later I'll check the contents of @Test using Data::Dumper (btw thanks for the tip!) and describe the results.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Slovenian characters problem
by graff (Chancellor) on Aug 18, 2010 at 08:04 UTC | |
by JackVanRamars (Novice) on Aug 18, 2010 at 10:58 UTC | |
by JackVanRamars (Novice) on Aug 18, 2010 at 11:50 UTC |