RE: [PBML] rss/unicode problem??
- leegold <leegold@...> wrote:
: Sent: Tuesday, April 06, 2004 8:36 PM
: To: email@example.com
: Subject: Re: [PBML] rss/unicode problem??
It is usual to start a new thread without the Re: at the
beginning the subject. Re: is usually reserved for replies.
: Got a problem. I think if has something to do with
: unicode. I read some very dry docs. on the web on unicode
: but not sure how to fix my problem. I'm using "rss2html -
: converts an RSS file to HTML" I have the code listed below
: the warnings and errors I get. The script is freely
: available on the web and as a relative newbie I am
: learning a lot from it. Ok, I get warnings after i run it,
: and I get garbage chars in the hmtl output file. Any fix
[snipped code -- thank you for including it]
I hadn't encountered this error before, so I loaded your
script and added:
Here's what I got:
Wide character in print at cc.pl line 77 (#1)
(W utf8) Perl met a wide character (>255) when it wasn't
expecting one. This warning is by default on for I/O
(like print). The easiest way to quiet this warning is
simply to add the :utf8 layer to the output, e.g.
binmode STDOUT, ':utf8'. Another way to turn off the
warning is to add no warnings 'utf8'; but that is often
closer to cheating. In general, you are supposed to
explicitly mark the filehandle with an encoding, see
open and perlfunc/binmode.
So I added the following before my first print statement
and everything quieted down.
binmode STDOUT, ':utf8';
Charles K. Clarkson
Mobile Homes Specialist