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

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

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
September 24, 2007 02:23
Subject:
Re: [perl #45673] parsing in eval() varies with UTF8ness
Message ID:
b77c1dce0709240142o44319603y35383578734aa972@mail.gmail.com
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.

> 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.

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