RE: RE: Wide character in print error

"Tim Turner" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.pdfapi2
Message-ID <20070713011612.UIP28877.ibm70aec.bellsouth.net@SONYXP2003>
 
I am outputting codes for trademark, copyright, and a bullet... Maybe those
are unicode?
	# define special chars
	$trademark = "\x{2122}";
	$registered_trademark = "\x{ae}";
	$copyright = "\x{a9}";
	$bullet = "\x{2022}";
Are those unicode?????????

The version of perl is v5.8.7 for the one that fails.  When it fails the pdf
returned is garbage and it says that it is a corrupted doc.

The version of perl is v5.8.5 for the server that works.


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Rick Measham
Sent: Thursday, July 12, 2007 6:05 PM
To: [email protected]
Subject: Re: [perl-text-pdf-modules] RE: Wide character in print error

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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.