What OS are you using? What version of Perl? What sort of tool do you use to view the data correctly? Are you using that same tool to view the Perl output?

If you have written a perl script yourself, please post it if it's fairly short. (If it's really long, try to show us a short script that demonstrates the same problem with your data.) If you are using a script that you downloaded from somewhere, can you tell us where you got that?

Do you know enough about character encodings to tell us what encoding is used by your input data? I would suggest trying to post a relevant sample of data with accents, but I'm not sure how reliable that would be (the data might get altered in a variety of ways that might be beyond your control) -- still, that might be worth a try.

Come to think of it, I wonder if the "bad" characters I see in your post are the ones you intended: I'm seeing U+00DE ("capital letter thorn") and U+2554 ("box drawings double down and right", which is typically 0xC9 in the old DOS code pages). You can look up unicode code points and get other useful info on encodings at http://www.unicode.org.

Anyway, it's hard for us to say what should be done until you give us more information (code and data).


In reply to Re: French Accents in perl by graff
in thread French Accents in perl by audoushka

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.