develooper Front page | perl.perl5.porters | Postings from March 2007

Re: the utf8 flag (was Re: [perl #41527] decode_utf8 sets utf8 flag on plain ascii strings)

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
March 30, 2007 05:31
Subject:
Re: the utf8 flag (was Re: [perl #41527] decode_utf8 sets utf8 flag on plain ascii strings)
Message ID:
20070330123122.GS5748@plum.flirble.org
On Fri, Mar 30, 2007 at 02:18:14PM +0200, Marc Lehmann wrote:
> On Fri, Mar 30, 2007 at 01:07:22PM +0100, Nicholas Clark <nick@ccl4.org> wrote:
> > > And the problem is that those bugs are not considered bugs but features.
> > 
> > I certainly consider this one a bug.
> 
> So fix it. It is easy to do, and I documented it years ago (during 5.6).

"this one" that I was confident is a bug is the change of meaning on SvPV()
And in turn what I'm not confident about is the fix.

> Besides, without any doubt, the code that relies on psuedo-random
> behaviour is certainkly in the minority. The amount of code in the wild
> that relies on "C" having 5.5 semantics is much larger. I doubt _anybody_
> except me (or at leats not very many people) understands that he has to
> downgrade scalars before passing them into unpack to decode structures.

I don't know enough about "C" in pack offhand to know what the right thing to
do is.

I don't like anything Perl space that lets the abstraction leak, and "C" is
one of them.

The third thing that you didn't mention which I consider distinct from the two
behaviours you did is that the encoding effects how regexps match, and
lc/uc/lcfirst/ucfirst.

Nicholas Clark

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