encoding problem?
- From: braedsjaa@xxxxxxxxxxx
- Date: Thu, 27 Sep 2007 04:27:18 -0700
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!)
.
- Follow-Ups:
- Re: encoding problem?
- From: Nobull67@xxxxxxxxx
- Re: encoding problem?
- From: Rob Dixon
- Re: encoding problem?
- Prev by Date: Re: help regarding Comparision of two lines
- Next by Date: Re: $File::Find and no_chdir
- Previous by thread: Re: ::Find and no_chdir
- Next by thread: Re: encoding problem?
- Index(es):
Relevant Pages
|