asifk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, I am using Perl 5.8. When I try printing certain characters I am getting the following error. "Wide character in print at....." What does this error mean? Does this mean that the character is malformed? Please enlighten me..

Replies are listed 'Best First'.
Re: Wide character error
by Anonymous Monk on Oct 01, 2004 at 10:39 UTC
    How to RTFM
    perldoc perldiag
    (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 the open manpage and binmode in the perlfunc manpage.
Re: Wide character error
by graq (Curate) on Oct 01, 2004 at 11:49 UTC