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++; }

In reply to Printing portugese text in Excel by raja567

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.