in reply to Unusual output with french accented letters

This is a Mac charset problem. My terminal is UTF-8:

$ echo -n ‚Äô|recode ..macintosh | xxd 0000000: e280 99 ... $ echo `echo -n ‚Äô|recode ..macintosh` ’
This means that when I take the mangled characters from "Ainsi j’appelle" and convert them to the traditional Mac charset, the resulting byte sequence interpreted as UTF-8 is an apostrophe. So the reverse must be the case for your file: you are assuming an 8-bit Mac charset but the file is actually UTF-8. Either convert the files by hand using recode or iconv, or use Encode::Guess or similar to detect the encoding on the fly.

Replies are listed 'Best First'.
Re^2: Unusual output with french accented letters
by JHG (Initiate) on May 22, 2012 at 14:35 UTC

    Thank you for your time to start with. I went a step further and noticed the following. In my PERL code I have the following HTML tag

    --HTML poésieBEGIN--

    This piece is a part of what I tell PERL to print in the outpout windows so I can copy/paste into a HTML file, really straitghtforward ins'nt it!

    But in the PERL output windows already it becomes --HTML poésieBEGIN--

    where √© stands for the character é. The strangest part is that there are other é before and after in the code and they come out correctly as é !!!

    The use of the module you suggest is beyond my grasp I am afraid, thanks anyway

      But in the PERL output windows already it becomes --HTML po√©sieBEGIN-- where √© stands for the character é. The strangest part is that there are other é before and after in the code and they come out correctly as é !!!

      Hm, strange. I think that calls for a hex editor. Apparently your text editor is hiding some differences from you that your shell chokes on, so you'd have to try and find the byte or bytes in your source that represent the é in each case. Or maybe it's something with your code, but you'd have to show it.