Front page | perl.perl5.porters |
Postings from August 2009
[perl #68812] "use utf8" accidentally sets utf8 flag on all barewords including ascii characters
From:
Tatsuhiko Miyagawa
Date:
August 27, 2009 02:09
Subject:
[perl #68812] "use utf8" accidentally sets utf8 flag on all barewords including ascii characters
Message ID:
rt-3.6.HEAD-2466-1251320900-1651.68812-75-0@perl.org
# New Ticket Created by "Tatsuhiko Miyagawa"
# Please include the string: [perl #68812]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=68812 >
The following test fails both on 5.10.1 and blead (per chip on #p5p).
The bareword on the left side of fat comma (=>) always gets utf8 flag
set, even if the characters only consist of ascii chars. See
http://www.perlmonks.org/?node_id=668987 for more details.
use strict;
use utf8;
use Test::More tests => 2;
my %foo = (a => 'b', 'c' => 'd');
for my $key (keys %foo) {
ok !utf8::is_utf8($key), "'$key' shouldn't have utf8 flag";
}
---
Flags:
category=
severity=
---
This perlbug was built using Perl 5.10.0 - Sat Jul 25 12:57:07 PDT 2009
It is being executed now by Perl 5.10.1 - Wed Aug 19 01:25:08 PDT 2009.
Site configuration information for perl 5.10.1:
Configured by miyagawa at Wed Aug 19 01:25:08 PDT 2009.
Summary of my perl5 (revision 5 version 10 subversion 1) configuration:
Platform:
osname=darwin, osvers=9.7.0, archname=darwin-2level
uname='darwin macbook-miyagawa.local 9.7.0 darwin kernel version
9.7.0: tue mar 31 22:52:17 pdt 2009; root:xnu-1228.12.14~1release_i386
i386 '
config_args='-Dprefix=/opt/local -des'
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-fno-common -DPERL_DARWIN -no-cpp-precomp
-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include
-I/opt/local/include',
optimize='-O3',
cppflags='-no-cpp-precomp -fno-common -DPERL_DARWIN
-no-cpp-precomp -fno-strict-aliasing -pipe -fstack-protector
-I/usr/local/include -I/opt/local/include'
ccversion='', gccversion='4.0.1 (Apple Inc. build 5493)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags ='
-fstack-protector -L/usr/local/lib -L/opt/local/lib'
libpth=/usr/local/lib /opt/local/lib /usr/lib
libs=-ldbm -ldl -lm -lutil -lc
perllibs=-ldl -lm -lutil -lc
libc=/usr/lib/libc.dylib, so=dylib, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup
-L/usr/local/lib -L/opt/local/lib -fstack-protector'
Locally applied patches:
---
@INC for perl 5.10.1:
/opt/local/lib/perl5/5.10.1/darwin-2level
/opt/local/lib/perl5/5.10.1
/opt/local/lib/perl5/site_perl/5.10.1/darwin-2level
/opt/local/lib/perl5/site_perl/5.10.1
.
---
Environment for perl 5.10.1:
DYLD_LIBRARY_PATH (unset)
HOME=/Users/miyagawa
LANG=ja_JP.UTF-8
LANGUAGE (unset)
LC_MESSAGES=C
LC_TIME=C
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/Users/miyagawa/.gem/ruby/1.8/bin:/Users/miyagawa/perl5/bin:/Users/miyagawa/local/bin:/Users/miyagawa/bin:/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/local/bin:/usr/bin:/usr/local/ssl/bin:/usr/local/samba/bin:/usr/local/java/bin:/var/qmail/bin:/usr/local/pgsql/bin:/usr/local/mysql/bin:/usr/local/apache/bin:/usr/local/squid/bin:/usr/local/git/bin:/opt/local/bin:/opt/local/sbin
PERL5LIB=
PERL_AUTOINSTALL_PREFER_CPAN=1
PERL_BADLANG=0
PERL_MM_OPT=INSTALL_BASE=/Users/miyagawa/perl5
SHELL=/bin/tcsh
-
[perl #68812] "use utf8" accidentally sets utf8 flag on all barewords including ascii characters
by Tatsuhiko Miyagawa