encoding problem?



I am trying to use perl on the command line to process text files in
various ways, one of which is to decode html entities. As far as I can
see, the following line should work

perl -MHTML::Entities -p -e 'decode_entities($_)' <input.txt
output.txt

it does indeed change the html entities, but not into the required
characters, rather into pairs of unusual characters; and the command
line returns this:

Wide character in print, <> line 1.

It seems to me it is something to do with internal character encoding
being messed up but I can't work out how to control it. The text files
processed have MacOS character encoding which is required in the
finished file, but perhaps I need to convert to UTF8 before processing
and back again after?

(I am seriously new to this - only started looking at Perl yesterday!)

.



Relevant Pages

  • Re: open and ñ
    ... > I'm making an gui for a program and therefor I use the ... But when I type my command in an eterm ... How can I stop perl from changing this ... > character into another one? ...
    (perl.beginners)
  • open and Q?=
    ... I'm making an gui for a program and therefor I use the ... But when I type my command in an eterm everything ... How can I stop perl from changing this character into ...
    (perl.beginners)
  • Re: Search.bat from the command line
    ... and I would like to search for a special character, ... Perl command line, meaning after I type "Perl" at the commadn prompt, ... would you provide more informatino on how I would use an HTML ...
    (comp.lang.perl.misc)
  • Re: Search.bat from the command line
    ... and I would like to search for a special character, ... Perl command line, meaning after I type "Perl" at the commadn prompt, ... Since you haven't shown us the code, it is hard to tell what the problem is, but an educated guess is that your program is using regular expressions to locate the search string. ...
    (comp.lang.perl.misc)
  • vi editor FAQ (Frequently Asked Question List), Part 2/2
    ... has the UCB distribution of vi, and lots of useful macros. ... m0 is the ex command to move the line to line 0. ... Swap character and one vertically above: ... A non-visual editor under Unix. ...
    (comp.unix.questions)