Java Mailing List Archive

http://www.apache-httpd.com/

Home » modperl.perl »

Re: quick pure perl question

Andy Armstrong

2009-06-30

Replies: Find Java Web Hosting

Author LoginPost Reply
On 30 Jun 2009, at 14:13, André Warnier wrote:
> I /would/ have expected it if I was /not/ specifying an encoding,
> like using simply '>'. But not when I am explicitly specifying
> '>:raw', which in my mind, and according to my interpretation of the
> on-line documentation, is equivalent to saying "output whatever you
> have as bytes in that string variable right now, as is, I know what
> I'm doing".


You have that bit right - but the string doesn't contain bytes[1] - it
contains characters. Strings can either be an octet stream or a stream
of wide characters. By reading utf8 into a string you've turned it
into the latter. Perl's warning that you're pushing character data
into an octet hole.

[1] of course it's /made/ of bytes but that's not how Perl sees it.

--
Andy Armstrong, Hexten

©2008 apache-httpd.com - Jax Systems, LLC, U.S.A.