Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encode::decode doesn't support CHECK=FB_CROAK #7431

Open
p5pRT opened this issue Jul 22, 2004 · 1 comment
Open

Encode::decode doesn't support CHECK=FB_CROAK #7431

p5pRT opened this issue Jul 22, 2004 · 1 comment

Comments

@p5pRT
Copy link

p5pRT commented Jul 22, 2004

Migrated from rt.perl.org#30774 (status was 'new')

Searchable as RT30774$

@p5pRT
Copy link
Author

p5pRT commented Jul 22, 2004

From perlbug@plan9.de

Created by perlbug@plan9.de

This is my first venture into "Encode" land, so I am not accustomed to
Encode, but still I believe that this is a bug.

I tried the following program on debians 5.8.4 perl, as well as my own
(5.8.4-based) perl. The latter has Encode 1.99_01 and Encode​::JP 1.25
(as well as others) installed. The debian perl uses Encode 1.99 and
Encode​::JP 1.25.

  use Encode;

  $test = "xx\x{b0}yy";
  $test = encode "iso-8859-1", $test, 1;

  $prefix = decode "iso-2022-jp", $test, 1;

  warn "prefix is $prefix, test is $test\n";

This outputs​:

  prefix is xx, test is °yy

(the ° is the \x{b0]).

Now, the original string is not valid iso-2022-jp, so I would expect
it to croak as advertised. It behaves as if FB_QUIET were specified,
though. Replacing the decode line with​:

  $prefix = decode "utf-8", $test, 1;

Results in a die​:

  utf8 "\xB0" does not map to Unicode at /opt/perl/lib/perl5/Encode.pm line 164.

So the behaviour is at least inconsistent.

Perl Info

Flags:
    category=library
    severity=low

Site configuration information for perl v5.8.4:

Configured by Marc Lehmann at Sat May  8 01:33:16 CEST 2004.

Summary of my perl5 (revision 5 version 8 subversion 4 patch 22795) configuration:
  Platform:
    osname=linux, osvers=2.6.5, archname=i386-linux
    uname='linux cerebro 2.6.5 #1 smp sat apr 17 17:55:51 cest 2004 i686 gnulinux '
    config_args='-Duselargefiles -Uuse64bitint -Uuse64bitall -Dusemymalloc=y -Dcc=gcc-3.4 -Dccflags=-ggdb -Dcppflags=-D_GNU_SOURCE -I/opt/include -Doptimize=-O4 -march=pentiumpro -mtune=pentium3 -fno-strict-aliasing -Dcccdlflags=-fPIC -Dldflags=-L/opt/perl/lib -L/opt/lib -Dlibs=-ldl -lm -lcrypt -Darchname=i386-linux -Dprefix=/opt/perl -Dprivlib=/opt/perl/lib/perl5 -Darchlib=/opt/perl/lib/perl5 -Dvendorprefix=/opt/perl -Dvendorlib=/opt/perl/lib/perl5 -Dvendorarch=/opt/perl/lib/perl5 -Dsiteprefix=/opt/perl -Dsitelib=/opt/perl/lib/perl5 -Dsitearch=/opt/perl/lib/perl5 -Dsitebin=/opt/perl/bin -Dman1dir=/opt/perl/man/man1 -Dman3dir=/opt/perl/man/man3 -Dsiteman1dir=/opt/perl/man/man1 -Dsiteman3dir=/opt/perl/man/man3 -Dman1ext=1 -Dman3ext=3 -Dpager=/usr/bin/less -Uafs -Uusesfio -Uusenm -Uuseshrplib -Dd_dosuid -Dusethreads=undef -Duse5005threads=undef -Duseithreads=undef -Dusemultiplicity=undef -Demail=perl-binary@plan9.de -Dcf_email=perl-binary@plan9.de -Dcf_by=Marc Lehmann -Dlocincpth=/opt/perl/include /opt/include -Dmyhostname=localhost -Dmultiarch=undef -Dbin=/opt/perl/bin -des'
    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=y, bincompat5005=undef
  Compiler:
    cc='gcc-3.4', ccflags ='-ggdb -fno-strict-aliasing -I/opt/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-O4 -march=pentiumpro -mtune=pentium3 -fno-strict-aliasing',
    cppflags='-D_GNU_SOURCE -I/opt/include -ggdb -fno-strict-aliasing -I/opt/include'
    ccversion='', gccversion='3.4.0 (Debian)', 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='gcc-3.4', ldflags ='-L/opt/perl/lib -L/opt/lib -L/usr/local/lib'
    libpth=/usr/local/lib /lib /usr/lib /usr/ucblib
    libs=-ldl -lm -lcrypt
    perllibs=-ldl -lm -lcrypt
    libc=/lib/libc-2.3.2.so, so=so, useshrplib=false, libperl=libperl.a
    gnulibc_version='2.3.2'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
    cccdlflags='-fPIC', lddlflags='-shared -L/opt/perl/lib -L/opt/lib -L/usr/local/lib'

Locally applied patches:
    MAINT22729


@INC for perl v5.8.4:
    /root/src/sex
    /opt/perl/lib/perl5
    /opt/perl/lib/perl5
    /opt/perl/lib/perl5
    /opt/perl/lib/perl5
    /opt/perl/lib/perl5
    /opt/perl/lib/perl5
    /opt/perl/lib/perl5
    .


Environment for perl v5.8.4:
    HOME=/root
    LANG (unset)
    LANGUAGE (unset)
    LC_CTYPE=de_DE.UTF-8
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/root/s2:/root/s:/opt/qt/bin:/opt/bin:/opt/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11/bin:/usr/games:/usr/local/bin:/usr/local/sbin:.:/root/src/uunet
    PERL5LIB=/root/src/sex
    PERL5_CPANPLUS_CONFIG=/root/.cpanplus/config
    PERLDB_OPTS=ornaments=0
    PERL_BADLANG (unset)
    PERL_UNICODE=SAL
    SHELL=/bin/bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants