develooper Front page | perl.perl5.porters | Postings from December 2012

Re: [perl #109828] PerlIO::scalar does not handle UTF-8

Thread Previous
Peter Rabbitson
December 29, 2012 14:43
Re: [perl #109828] PerlIO::scalar does not handle UTF-8
Message ID:
On Fri, Dec 28, 2012 at 11:16:36PM +0100, Leon Timmermans wrote:
> On Fri, Dec 28, 2012 at 11:06 PM, Tony Cook via RT
> <> wrote:
> > It should fail to open.  If you open a UTF8 flagged string for append
> > and write non-UTF8 bytes you will produce an invalidly encoded SvUTF8
> > string.
> >
> > Your patch as written ignores the principle that the SvUTF8() flag only
> > controls the internal encoding, not other behaviour.  If the SV contains
> > only code point 0xFF or lower we should downgrade it and work with that
> > rather than failing (or producing a warning).
> I didn't see enough consensus to change it that much, but I would be in favor.
> > This should also be done for _read() and _write(), since the SV can be
> > modified between I/O operations.
> >
> > There's an unrelated problem that _pushed() checks flags on both arg and
> > SvRV(arg) without calling SvGETMAGIC().
> It should just stop peeking and poking into the SV altogether, and use
> the proper APIs (sv_insert and friends). For that matter, I sometimes
> feel like it should be rewritten from scratch to actually make sense.
> Pretty much all of it is problematic.

This particular bit risks derailing the simpler yet more urgent bugfix. 
Focuse please ;)


Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About