develooper Front page | perl.perl5.porters | Postings from February 2003

[perl #20785] glitches with $PerlIO::encoding::fallback

Thread Next
From:
perlbug-followup
Date:
February 8, 2003 19:49
Subject:
[perl #20785] glitches with $PerlIO::encoding::fallback
Message ID:
rt-20785-50586.6.45611613038412@bugs6.perl.org
# New Ticket Created by  autrijus@ossf.iis.sinica.edu.tw 
# Please include the string:  [perl #20785]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=20785 >


This is a bug report for perl from autrijus@ossf.iis.sinica.edu.tw,
generated with the help of perlbug 1.34 running under perl v5.8.0.


-----------------------------------------------------------------
[Please enter your report here]

First, the ::fallback variable was misdocumented as ::check.
The patch below corrects this.

Next, the ::fallback's behaviour is inconsistent:

    use Encode;
    $PerlIO::encoding::fallback = Encode::HTMLCREF;
    binmode(STDOUT, 'encoding(iso-8859-1)');
    print "\x{1234}";       # prints '\x{1234}'
    $PerlIO::encoding::fallback = Encode::HTMLCREF;
    binmode(STDOUT, 'encoding(iso-8859-1)');
    print "\x{1234}";       # prints '&#4660;'!

Thanks,
/Autrijus/

--- encoding.pm.orig	Thu Feb  6 06:16:00 2003
+++ encoding.pm	Thu Feb  6 06:16:33 2003
@@ -27,7 +27,7 @@
   open($f, ">:encoding(bar)", "outbar");
 
   use Encode qw(:fallbacks);
-  $PerlIO::encoding::check = FB_PERLQQ;
+  $PerlIO::encoding::fallback = FB_PERLQQ;
 
 =head1 DESCRIPTION
 
@@ -38,7 +38,7 @@
 Perl's internal Unicode encoding, UTF-8).  On output, convert
 Perl string data into the specified character set and encoding.
 
-When the layer is pushed the current value of C<$PerlIO::encoding::check>
+When the layer is pushed the current value of C<$PerlIO::encoding::fallback>
 is saved and used as the check argument when calling the Encodings
 encode and decode.
 

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=low
---
Site configuration information for perl v5.8.0:

Configured by autrijus at Wed Jan 29 01:08:17 CST 2003.

Summary of my perl5 (revision 5.0 version 8 subversion 0 patch 18590) configuration:
  Platform:
    osname=freebsd, osvers=4.7-release-p3, archname=i386-freebsd
    uname='freebsd ossf.iis.sinica.edu.tw 4.7-release-p3 freebsd 4.7-release-p3 #2: tue jan 14 14:34:03 cst 2003 root@ossf.iis.sinica.edu.tw:usrsrcsyscompileossf i386 '
    config_args='-sde -Dprefix=/usr/local -Darchlib=/usr/local/lib/perl5/5.8.0/mach -Dprivlib=/usr/local/lib/perl5/5.8.0 -Dman3dir=/usr/local/lib/perl5/5.8.0/man/man3 -Dsitearch=/usr/local/lib/perl5/site_perl/5.8.0/mach -Dsitelib=/usr/local/lib/perl5/site_perl/5.8.0 -Ui_malloc -Ui_iconv -Uinstallusrbinperl -Dccflags=-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.0/BSDPAN" -Ui_gdbm -Dusemymalloc=n'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef 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 ='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.0/BSDPAN" -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -I/usr/local/include',
    optimize='-O',
    cppflags='-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.0/BSDPAN" -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='2.95.4 20020320 [FreeBSD]', 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, prototype=define
  Linker and Libraries:
    ld='cc', ldflags ='-Wl,-E  -L/usr/local/lib'
    libpth=/usr/lib /usr/local/lib
    libs=-lm -lc -lcrypt -lutil
    perllibs=-lm -lc -lcrypt -lutil
    libc=, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
    cccdlflags='-DPIC -fpic', lddlflags='-shared  -L/usr/local/lib'

Locally applied patches:
    MAINT18448

---
@INC for perl v5.8.0:
    /usr/local/lib/perl5/5.8.0/BSDPAN
    /usr/local/lib/perl5/5.8.0/mach
    /usr/local/lib/perl5/5.8.0
    /usr/local/lib/perl5/site_perl/5.8.0/mach
    /usr/local/lib/perl5/site_perl/5.8.0
    /usr/local/lib/perl5/site_perl
    .

---
Environment for perl v5.8.0:
    HOME=/home/autrijus
    LANG (unset)
    LANGUAGE (unset)
    LC_CTYPE=zh_TW.UTF-8
    LD_LIBRARY_PATH=/usr/local/lib
    LOGDIR (unset)
    PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:/home/autrijus/bin
    PERL_BADLANG (unset)
    SHELL=/usr/local/bin/psh


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