Loading ...
Sorry, an error occurred while loading the content.

RE: [PBML] rss/unicode problem??

Expand Messages
  • Charles K. Clarkson
    ... FYI: It is usual to start a new thread without the Re: at the beginning the subject. Re: is usually reserved for replies. ... [snipped code -- thank you
    Message 1 of 2 , Apr 7 6:09 PM
    • 0 Attachment
      leegold <leegold@...> wrote:
      : Sent: Tuesday, April 06, 2004 8:36 PM
      : To: perl-beginner@yahoogroups.com
      : Subject: Re: [PBML] rss/unicode problem??

      FYI:
      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
      : appreciated.

      [snipped code -- thank you for including it]


      I hadn't encountered this error before, so I loaded your
      script and added:

      use diagnostics;

      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';

      HTH,

      Charles K. Clarkson
      --
      Mobile Homes Specialist
      254 968-8328
    Your message has been successfully submitted and would be delivered to recipients shortly.