develooper Front page | perl.perl5.porters | Postings from August 2009

Re: [perl #45673] parsing in eval() varies with UTF8ness

Thread Previous | Thread Next
From:
Chip Salzenberg
Date:
August 26, 2009 14:56
Subject:
Re: [perl #45673] parsing in eval() varies with UTF8ness
Message ID:
20090826215550.GF8422@tytlal.topaz.cx
On Mon, Sep 24, 2007 at 10:42:37AM +0200, Rafael Garcia-Suarez wrote:
> On 23/09/2007, Tels <nospam-abuse@bloodgate.com> wrote:
> > When you don't do "use utf8;" you script is expected to be in latin1
> > (iso.-8859-1). (we leave "use locale" out of this for now). Under use utf8,
> > it can contain any UTF-8.
> >
> > However, it seems eval() (or require?) doesn't know about this.
> 
> Right, there can be double encoding. That will need to be fixed.

I disagree.  The only extra encoding is manual here.  The call to
utf8::upgrade is performing that encoding step explicitly at the user's
request.

I call no bug.



> 
> > Plus, I am
> > not entirely sure how much Unicode you can use in identifiers as something
> > like this:
> >
> >         #!perl
> >         use utf8;
> >         my $? = 1;
> >
> > still fails to compile with:
> >
> >         Unrecognized character \x82 at t.pl line 5.
> >
> > perldoc perlsyn (in 5.8.8) doesn't seem to say anything about identifiers.
> 
> Identifiers must start with letters; ? isn't one.
> 
> [rafael@stcosmo ~]$ bleadperl -Mutf8 -le '$à=42;print $à'
> 42
> [rafael@stcosmo ~]$ bleadperl -le '$à=42;print $à'
> Unrecognized character \xA0 in column 3 at -e line 1.

-- 
Chip Salzenberg

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