Re: Spread***::Read special characters handling
- From: "Mumia W. (reading news)" <paduille.4060.mumia.w@xxxxxxxxxxxxx>
- Date: Mon, 20 Nov 2006 15:04:56 GMT
On 11/20/2006 01:33 AM, anevare2@xxxxxxxxx wrote:
I'm using the Spread***::Read module (which works quite well
generally). I have some spreadsheets with special characters like an
accented e (é). I'm having some trouble processing these characters.
I haven't dealt much with these type of characters in this context in
the past. The accented e's are coming out like "?".
My spread*** has cells A1, A2 and A3 set to Cafe like the following:
in A1, excel automatically made the accented e, in A2, i pressed Option
e e for the accented e, and A3, I undid the special e to make it a
regular e
A1:A3
---------
Café
Café
Cafe
This is my program
------------------------------
use Spread***::Read;
my $ref = ReadData('special_char_test.xls');
my $cell1 = $ref->[1]{A1};
my $cell2 = $ref->[1]{cell}[1][2]; #try different way
my $cell3 = $ref->[1]{cell}[1][3];
print "Cell A1: $cell1\n";
print "Cell A2: $cell2\n";
print "Cell A3: $cell3\n";
Output (standard out):
-------------------
Cell A1: Caf?
Cell A2: Caf?
Cell A3: Cafe
What can I do so that the accented e prints correctly or so the correct
format can be saved to a csv file?
Thanks.
A.
I have no problems outputting accented characters from Spread***::Read. Either your Perl or your terminal is not able to deal with the accented characters.
Try placing "use encoding 'iso-8859-1;' at the top of your program.
Recent versions of Perl (>= 5.8) should be able to handle character encodings well, but you might have to set up your locale properly, and you might have to configure your terminal to display those characters.
--
paduille.4060.mumia.w@xxxxxxxxxxxxx
.
- References:
- Spread***::Read special characters handling
- From: anevare2
- Spread***::Read special characters handling
- Prev by Date: Re: Spread***::Read special characters handling
- Next by Date: Trouble installing from CPAN
- Previous by thread: Re: Spread***::Read special characters handling
- Next by thread: Trouble installing from CPAN
- Index(es):