develooper Front page | perl.perl5.porters | Postings from May 2003

Re: Meaning of sysread()

Thread Previous | Thread Next
From:
Jarkko Hietaniemi
Date:
May 21, 2003 06:11
Subject:
Re: Meaning of sysread()
Message ID:
20030521131115.GG16702@kosh.hut.fi
> It tries. Because the "top" of the PerlIO layer stack (which is what 
> pp_sysread() sees) is marked as :utf8. But if that is because 
> the stack is 
> 
> :unix :perlio :encoding(big5)
> 
> and it is :encoding that is spitting UTF-8. Now when sysread
> dives down and calls read(2) then pp_sysread is going to get 
> big5 octet stream - and the UTF-8 completion logic in pp_sysread()
> is going to barf.

Ahhh, okay.  True.  It now works only with sysread() only iff the
stream is UTF-8, not with any random encoding.  And if we want to
stick with the "bytes" interpretation, and I think we should, there's
no need to "fix" this to work with arbitrary encodings, either.

My suggestion: pedal down and/or tighten the language in
perlfunc/sysread (and -write) to primarily talk of bytes,
and mention characters only in the context of an explicit :utf8.

-- 
Jarkko Hietaniemi <jhi@iki.fi> http://www.iki.fi/jhi/ "There is this special
biologist word we use for 'stable'.  It is 'dead'." -- Jack Cohen

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About