raja567 has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I'm trying to print the text "ID Serviço Vantive" in excel sheet using the following code, but in Excel it is getting displayed as "ID Sevio Vantive". The character 'ç' is getting missed, I know it is because of encoding,decoding of characters but tried few ways to fix it and none of them worked. Can anyone help me how to get rid of this problem?
use Locale::Msgcat; use Number::Localization; use Presentation; use utf8; use Encode ; my $rowCount = 0; my $colCount = 0; my $Field = ""; my $workbook = Excel::Writer::XLSX->new('test.xlsx'); $worksheet = $workbook->add_worksheet(); $worksheet->set_column( 0, 10, 40 ); my $gFmtBold = $workbook->add_format(); $gFmtBold->set_bold(); $gFmtBold->set_size(15); $gFmtBold->set_color('black'); $gFmtBold->set_align('center'); my $normalFmt = $workbook->add_format(); $normalFmt->set_align('center'); my (@outRecord); @outRecord = ("Nome do Produto","ID Serviço Vantive","Motivo","Quantid +ade"); foreach $Field (@outRecord) { $worksheet->set_column($rowCount,$colCount,40); $worksheet->write($rowCount,$colCount,decode('utf8',$Field),$gFm +tBold); $colCount++; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Printing portugese text in Excel
by choroba (Cardinal) on Apr 20, 2015 at 10:00 UTC | |
by raja567 (Novice) on Apr 20, 2015 at 10:10 UTC | |
by choroba (Cardinal) on Apr 20, 2015 at 10:12 UTC | |
by raja567 (Novice) on Apr 20, 2015 at 10:26 UTC | |
by marinersk (Priest) on Apr 20, 2015 at 11:58 UTC | |
|
Re: Printing portugese text in Excel
by pme (Monsignor) on Apr 20, 2015 at 10:47 UTC |