Skip Menu |

This queue is for tickets about the Encode CPAN distribution.

Report information
The Basics
Id: 70719
Status: resolved
Priority: 0/
Queue: Encode

People
Owner: Nobody in particular
Requestors: perlbug-followup [...] perl.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



CC: bug-Encode [...] rt.cpan.org
Subject: [perl #98370] Perl doesn't decode IBM037
Date: Sun, 04 Sep 2011 10:46:21 -0700
To: "OtherRecipients of perl Ticket #98370":;
From: "Father Chrysostomos via RT" <perlbug-followup [...] perl.org>
Forwarding to the CPAN queue.... On Sun Sep 04 06:05:20 2011, tomushkin@gmail.com wrote: Show quoted text
> > > This is a bug report for perl from tomushkin@gmail.com, > generated with the help of perlbug 1.39 running under perl 5.14.1. > > > ----------------------------------------------------------------- > [Please describe your issue here] > > # perl -MEncode -e 'decode("IBM037", "\x{a2}\x{97}\x{81}\x{94}")' > Unknown encoding 'IBM037' at -e line 1 > > My servers are spammed with IBM037 encoded email, that renders > properly by the most mail clients, but fails to decode by the > perl filters. For some reason, it doesn't alias to cp37, but > cp037. I use the following workaround: > > use Encode::Alias; > define_alias(qr/^cp0+(\d+)$/i => ''"cp$1"''); > > [Please do not change anything below this line] > ----------------------------------------------------------------- > --- > Flags: > category=library > severity=low > module=Encode > --- > Site configuration information for perl 5.14.1: > > Configured by nobody at Wed Jun 29 17:15:04 UTC 2011. > > Summary of my perl5 (revision 5 version 14 subversion 1) > configuration: > > Platform: > osname=linux, osvers=2.6.39-arch, archname=x86_64-linux-thread- > multi > uname='linux foutbox 2.6.39-arch #1 smp preempt mon jun 27 > 21:26:22 cest 2011 x86_64 amd phenom(tm) ii x6 1090t processor > authenticamd gnulinux ' > config_args='-des -Dusethreads -Duseshrplib > -Doptimize=-march=x86-64 -mtune=generic -O2 -pipe -Dprefix=/usr > -Dinstallprefix=/usr -Dvendorprefix=/usr > -Dprivlib=/usr/share/perl5/core_perl > -Darchlib=/usr/lib/perl5/core_perl > -Dsitelib=/usr/share/perl5/site_perl > -Dsitearch=/usr/lib/perl5/site_perl > -Dvendorlib=/usr/share/perl5/vendor_perl > -Dvendorarch=/usr/lib/perl5/vendor_perl > -Dscriptdir=/usr/bin/core_perl -Dsitescript=/usr/bin/site_perl > -Dvendorscript=/usr/bin/vendor_perl -Dinc_version_list=none > -Dman1ext=1perl -Dman3ext=3perl -Dcccdlflags='-fPIC' > -Dlddlflags=-shared -Wl,--hash-style=gnu -Wl,--as-needed > -Dldflags=-Wl,--hash-style=gnu -Wl,--as-needed' > hint=recommended, useposix=true, d_sigaction=define > useithreads=define, usemultiplicity=define > useperlio=define, d_sfio=undef, uselargefiles=define, > usesocks=undef > use64bitint=define, use64bitall=define, uselongdouble=undef > usemymalloc=n, bincompat5005=undef > Compiler: > cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing > -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE > -D_FILE_OFFSET_BITS=64', > optimize='-march=x86-64 -mtune=generic -O2 -pipe', > cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe > -fstack-protector -I/usr/local/include' > ccversion='', gccversion='4.6.1', gccosandvers='' > intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 > d_longlong=define, longlongsize=8, d_longdbl=define, > longdblsize=16 > ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', > lseeksize=8 > alignbytes=8, prototype=define > Linker and Libraries: > ld='cc', ldflags ='-Wl,--hash-style=gnu -Wl,--as-needed > -fstack-protector -L/usr/local/lib' > libpth=/usr/local/lib /lib/../lib /usr/lib/../lib /lib /usr/lib > libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc > -lgdbm_compat > perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc > libc=/lib/libc-2.14.so, so=so, useshrplib=true, libperl=libperl.so > gnulibc_version='2.14' > Dynamic Linking: > dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E > -Wl,-rpath,/usr/lib/perl5/core_perl/CORE' > cccdlflags='-fPIC', lddlflags='-shared -Wl,--hash-style=gnu > -Wl,--as-needed -L/usr/local/lib -fstack-protector' > > Locally applied patches: > > > --- > @INC for perl 5.14.1: > /usr/lib/perl5/site_perl > /usr/share/perl5/site_perl > /usr/lib/perl5/vendor_perl > /usr/share/perl5/vendor_perl > /usr/lib/perl5/core_perl > /usr/share/perl5/core_perl > . > > --- > Environment for perl 5.14.1: > HOME=/home/toma > LANG=en_US.UTF-8 > LANGUAGE (unset) > LC_ALL=en_US.UTF-8 > LD_LIBRARY_PATH= > LOGDIR (unset) >
PATH=/usr/local/bin:/usr/bin:/bin:/usr/games:/opt/java/jre/bin:/usr/bin/vendor_perl:/usr/lib/perl5/vendor_perl/bin:/usr/bin/core_perl Show quoted text
> PERL5LIB= > PERL_BADLANG (unset) > SHELL=/bin/zsh
iconv does not recognize IBM037 either. So consider that a feature, or lack thereof. FYI use Encode::Alias; define_alias(qr/^IBM0+(\d+)$/i => ''"cp$1"''); should do the trick you asked for. Dan the Maintainer Thereof On Sun Sep 04 13:46:29 2011, perlbug-followup@perl.org wrote: Show quoted text
> Forwarding to the CPAN queue.... > > On Sun Sep 04 06:05:20 2011, tomushkin@gmail.com wrote:
> > > > > > This is a bug report for perl from tomushkin@gmail.com, > > generated with the help of perlbug 1.39 running under perl 5.14.1. > > > > > > ----------------------------------------------------------------- > > [Please describe your issue here] > > > > # perl -MEncode -e 'decode("IBM037", "\x{a2}\x{97}\x{81}\x{94}")' > > Unknown encoding 'IBM037' at -e line 1 > > > > My servers are spammed with IBM037 encoded email, that renders > > properly by the most mail clients, but fails to decode by the > > perl filters. For some reason, it doesn't alias to cp37, but > > cp037. I use the following workaround: > > > > use Encode::Alias; > > define_alias(qr/^cp0+(\d+)$/i => ''"cp$1"''); > > > > [Please do not change anything below this line] > > ----------------------------------------------------------------- > > --- > > Flags: > > category=library > > severity=low > > module=Encode > > --- > > Site configuration information for perl 5.14.1: > > > > Configured by nobody at Wed Jun 29 17:15:04 UTC 2011. > > > > Summary of my perl5 (revision 5 version 14 subversion 1) > > configuration: > > > > Platform: > > osname=linux, osvers=2.6.39-arch, archname=x86_64-linux-thread- > > multi > > uname='linux foutbox 2.6.39-arch #1 smp preempt mon jun 27 > > 21:26:22 cest 2011 x86_64 amd phenom(tm) ii x6 1090t processor > > authenticamd gnulinux ' > > config_args='-des -Dusethreads -Duseshrplib > > -Doptimize=-march=x86-64 -mtune=generic -O2 -pipe -Dprefix=/usr > > -Dinstallprefix=/usr -Dvendorprefix=/usr > > -Dprivlib=/usr/share/perl5/core_perl > > -Darchlib=/usr/lib/perl5/core_perl > > -Dsitelib=/usr/share/perl5/site_perl > > -Dsitearch=/usr/lib/perl5/site_perl > > -Dvendorlib=/usr/share/perl5/vendor_perl > > -Dvendorarch=/usr/lib/perl5/vendor_perl > > -Dscriptdir=/usr/bin/core_perl -Dsitescript=/usr/bin/site_perl > > -Dvendorscript=/usr/bin/vendor_perl -Dinc_version_list=none > > -Dman1ext=1perl -Dman3ext=3perl -Dcccdlflags='-fPIC' > > -Dlddlflags=-shared -Wl,--hash-style=gnu -Wl,--as-needed > > -Dldflags=-Wl,--hash-style=gnu -Wl,--as-needed' > > hint=recommended, useposix=true, d_sigaction=define > > useithreads=define, usemultiplicity=define > > useperlio=define, d_sfio=undef, uselargefiles=define, > > usesocks=undef > > use64bitint=define, use64bitall=define, uselongdouble=undef > > usemymalloc=n, bincompat5005=undef > > Compiler: > > cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE
> -fno-strict-aliasing
> > -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE > > -D_FILE_OFFSET_BITS=64', > > optimize='-march=x86-64 -mtune=generic -O2 -pipe', > > cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe > > -fstack-protector -I/usr/local/include' > > ccversion='', gccversion='4.6.1', gccosandvers='' > > intsize=4, longsize=8, ptrsize=8, doublesize=8,
> byteorder=12345678
> > d_longlong=define, longlongsize=8, d_longdbl=define, > > longdblsize=16 > > ivtype='long', ivsize=8, nvtype='double', nvsize=8,
> Off_t='off_t',
> > lseeksize=8 > > alignbytes=8, prototype=define > > Linker and Libraries: > > ld='cc', ldflags ='-Wl,--hash-style=gnu -Wl,--as-needed > > -fstack-protector -L/usr/local/lib' > > libpth=/usr/local/lib /lib/../lib /usr/lib/../lib /lib /usr/lib > > libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc > > -lgdbm_compat > > perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc > > libc=/lib/libc-2.14.so, so=so, useshrplib=true,
> libperl=libperl.so
> > gnulibc_version='2.14' > > Dynamic Linking: > > dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E > > -Wl,-rpath,/usr/lib/perl5/core_perl/CORE' > > cccdlflags='-fPIC', lddlflags='-shared -Wl,--hash-style=gnu > > -Wl,--as-needed -L/usr/local/lib -fstack-protector' > > > > Locally applied patches: > > > > > > --- > > @INC for perl 5.14.1: > > /usr/lib/perl5/site_perl > > /usr/share/perl5/site_perl > > /usr/lib/perl5/vendor_perl > > /usr/share/perl5/vendor_perl > > /usr/lib/perl5/core_perl > > /usr/share/perl5/core_perl > > . > > > > --- > > Environment for perl 5.14.1: > > HOME=/home/toma > > LANG=en_US.UTF-8 > > LANGUAGE (unset) > > LC_ALL=en_US.UTF-8 > > LD_LIBRARY_PATH= > > LOGDIR (unset) > >
>
PATH=/usr/local/bin:/usr/bin:/bin:/usr/games:/opt/java/jre/bin:/usr/bin/vendor_perl:/usr/lib /perl5/vendor_perl/bin:/usr/bin/core_perl Show quoted text
> > PERL5LIB= > > PERL_BADLANG (unset) > > SHELL=/bin/zsh
> > >