perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Armstrong <a...@hexten.net>
Subject Re: quick pure perl question
Date Tue, 30 Jun 2009 13:33:22 GMT
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


Mime
View raw message