I am writing a Perl program which takes input from a column in an Excel spreadsheet listing names of European cars. This column is named "MenuList". The names of European cars often contain letters with symbols above them that are not seen in English, and which must be encoded in UTF-8 (Examples: é , Š , ë). Other cells in the same column lack these foreign symbols and are encoded in ASCII. I am writing out the contents of this column to an *.ini file.

I am finding that with the code shown below, the car names in ASCII are being written out to the *.ini file without problems, but the car names with foreign symbols - encoded in UTF-8 - are garbled in the *.ini file. These garbled strings are accompanied by the error message "Wide character in print"

Is there a way to read input from an Excel spreadsheet with mixed encoding (some cells in UTF-8, other cells in ASCII), and write contents of these cells to an *.ini file, with no garbled output in the *.ini from the cells that contained UTF-8 encoding?"

chomp $menuList[$i]; $decodedMenuList = decode("utf8",$menuList[$i]); $cfg_baselicense->newval($partNumList[$i],"MenuSelection",$decod +edMenuList); $cfg_baselicense->RewriteConfig();

In reply to Processing spreadsheet with some cells in ASCII, other cells in UTF-8 by Amphiaraus

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.