develooper Front page | perl.perl5.porters | Postings from February 2008

Re: use encoding 'utf8' bug for Latin-1 range

Thread Previous | Thread Next
Juerd Waalboer
February 21, 2008 02:53
Re: use encoding 'utf8' bug for Latin-1 range
Message ID:
Rafael Garcia-Suarez skribis 2008-02-21 11:34 (+0100):
> I agree with that plan. However, we have some useful code out there, and
> in the core, that uses ${^ENCODING}: notably the encoding::warnings
> module.

Just to put this in perspective: encoding::warnings is a debugging tool
and generally a bad idea in production code, IMHO.

> That's why fixing the calling steps of ${^ENCODING} methods might be
> worthwhile after all. So, no deprecation of ${^ENCODING} for now.

That will, however, break existing code using, or
encoding::source. Unless I'm mistaken, it's ${^ENCODING} that handles
the weird behaviour for \x and chr.

If this backwards incompatibility is ruled unimportant, the general
assumption would be: ${^ENCODING} acts on literal source code only, and
the fix would be to make numeric character values always unicode
codepoints. Is this correct?
Met vriendelijke groet,  Kind regards,  Korajn salutojn,

  Juerd Waalboer:  Perl hacker  <>  <>
  Convolution:     ICT solutions and consultancy <>

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