Re: RE: Wide character in print error
Rick Measham <rick-6wk1kIbWGY9Wo+R/V/U2/[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.pdfapi2 |
|---|---|
| Message-ID | <[email protected]> |
Tim Turner wrote:
> On another server it generates a corrupted file error. The web server error
> log has an entry for that script and says the error is "Wide character in
> print"...
That's not an error, it's a warning. Search perldoc perldiag for 'wide
character':
Wide character in %s
(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 "binmode" in perlfunc.
> Anyone run into this or know what it is referring to. I've looked at the
> line it mentions and I think it happened way before as the line it refers to
> is not relevant.
If you're building exactly the same PDF from exactly the same source
data then I'm guessing one machine may have it's locale set to a UTF8
charset and the other not. But I can't remember all the ins and outs.
Basically you're sending a UTF8 character to your PDF where it's just
expecting a single-byte character.
Cheers!
Rick Measham
To unsubscribe from this group, send an email to:
perl-text-pdf-modules-unsubscribe-Km8ibD4bFueDmjp1MlKEbA@public.gmane.org
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/perl-text-pdf-modules/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/perl-text-pdf-modules/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:perl-text-pdf-modules-digest-hHKSG33TihhbjbujkaE4pw@public.gmane.org
mailto:perl-text-pdf-modules-fullfeatured-hHKSG33TihhbjbujkaE4pw@public.gmane.org
<*> To unsubscribe from this group, send an email to:
perl-text-pdf-modules-unsubscribe-hHKSG33TihhbjbujkaE4pw@public.gmane.org
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/