Posted on 2006-10-30 14:09:30-08 by ramesh12
Problem in parsing non-english characters.
Hi,
Recently I'm facing some problems with this parser. My excel file has some chinese and japanese characters which I' not able to get correctly into the test file. My code snippet:
----

my $oBook = Spreadsheet::ParseExcel::Workbook->Parse($file); // correctly instantiated.
my($iR, $iC, $oWkS, $oWkC);
binmode STDOUT, ":utf8";
foreach my $oWkS (@{$oBook->{Worksheet}}) { // // correctly instantiated.
print "----- SHEET: ", $oWkS->{Name}, "\n";
for(my $iR = $oWkS->{MinRow} ;
defined $oWkS->{MaxRow} && $iR <= $oWkS->{MaxRow} ; $iR++) {
for(my $iC = $oWkS->{MinCol} ;
defined $oWkS->{MaxCol} && $iC <= $oWkS->{MaxCol} ; $iC++) {
$oWkC = $oWkS->{Cells}[$iR][$iC];

# there is content in this cell
if($oWkC) {
my $value = $oWkC->Value;
if($value ne "") {
print $value . $sep;
}
}
# oops, no content %&#@!?
else {
print $sep;
}
#print "( $iR , $iC ) =>", $oWkC->Value, "\n" if($oWkC);
}
print "\n";
}
}

----
Most of the other lnaguages are supported. Any help is appreciated.

The module version
# Spreadsheet::ParseExcel
# by Kawai, Takanori (Hippo2000) 2000.10.2
# 2001. 2.2 (Ver. 0.15)
# This Program is ALPHA version.


thanks
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.