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

[ID 20000918.005] ~ on wide chars

Thread Next
September 18, 2000 10:46
[ID 20000918.005] ~ on wide chars
Message ID:

This is a bug report for perl from,
generated with the help of perlbug 1.32 running under perl v5.7.0.

[Please enter your report here]

The ~ operation on UTF8 flagged strings does not do the right thing:

$ perl -MDevel::Peek -e 'Dump(~v300)'
SV = PV(0x8160cac) at 0x8160740
  REFCNT = 1
  PV = 0x816dee0 ";S"\0
  CUR = 2
  LEN = 3

It just flips the bits, but does not even turn off the UTF8 flag.

It is not clear to me what the operation should do.  One way is to use
0..10FFFF (the official range of UTF8) and flip bits based on that.
That seem kind of wrong.  I would suggest that we simply flip bits as
if the character was an 'int'.  (That would create a fairly long
string internally on 64bit machines.)

I would also argue that ~"\0" should evauate into the same as chr(~0)
unless inside 'use bytes' scope.  Currently it evaluates to chr(255).

[Please do not change anything below this line]
Site configuration information for perl v5.7.0:

Configured by gisle at Tue Sep  5 09:56:22 CEST 2000.

Summary of my perl5 (revision 5.0 version 7 subversion 0) configuration:
    osname=linux, osvers=2.2.14, archname=i686-linux-thread-multi
    uname='linux eik 2.2.14 #1 fri mar 17 11:59:50 gmt 2000 i686 unknown '
    config_args='-Dusedevel -Dprefix=/local/perl/5.7.0_thr -Dusethreads -Doptimize=-g -ders'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
    useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    cc='cc', ccflags ='-D_REENTRANT -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-g', cppflags='-D_REENTRANT -DDEBUGGING -fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='2.95.2 19991024 (release)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldbm -ldb -ldl -lm -lpthread -lc -lposix -lcrypt -lutil
    libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'

Locally applied patches:

@INC for perl v5.7.0:

Environment for perl v5.7.0:
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)

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