I don't have excel to test your script with, and I'm just beginning to get a handle on unicode, but a similar problem was recently resolved at
Re^3: Perl TK character disappearing. You can't decode your cp1252 input as utf-8. You can decode it as cp1252 then save it as utf8.
If I was able to run the code, this would be my first thing to try. I like the utf8::all module.
# this will make all filehandles and STDOUT prints be utf8
use utf8::all; # a very simple module
# get your excel rows and decode them
# Gives error "Cannot decode string with wide characters"
# map { $_ = decode("utf8", $_) } @row;
# decode the cp1252 stuff properly
map { $_ = decode("cp1252", $_) } @row;
# prints to the csv file will be utf8
Windows-1252 characters from \x{0080} thru \x{009f} might also be useful to you.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.