Posted on 2006-03-20 12:26:11-08 by szabgab
decoding Hebrew strings?
I am reading in an Excel file with Hebrew text in it.
It seems that Excel keeps thes string in UCS-2BE encoding, whatever that would be.
I am using this code but obviously I am not too satisfied with the idea of overriding the private classes of the module.

What else could I do with this?

sub Spreadsheet::ParseExcel::Simple::_Sheet::next_row { my @values; foreach my $cell (@{$_[0]->{sheet}->{Cells}[$_[0]->{row}++]}) { if ($cell) { if (defined $cell->{Code}) { if ($cell->{Code} eq "ucs2") { push @values, decode("UCS-2BE", $cell->{Val}); } else { push @values, ""; } } else { push @values, $cell->{Val}; } } else { push @values, ""; } return @values; }
Direct Responses: 1976 | 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.