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

Re: [perl #98370] Perl doesn't decode IBM037

Thread Previous | Thread Next
From:
Leon Timmermans
Date:
September 4, 2011 15:17
Subject:
Re: [perl #98370] Perl doesn't decode IBM037
Message ID:
CAHhgV8gAy-5v_f7MbaKsWUiaCrxTp5vxK=fbPniDbRjDnhQ+AA@mail.gmail.com
On Sun, Sep 4, 2011 at 3:05 PM, tomushkin@gmail.com
<perlbug-followup@perl.org> wrote:
> # 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"'');

Actually, there are a lot more encodings that have a codepage
number[1]. It could be useful to add aliases for all encodings that we
do support (after all, who knew cp65001 is actually just utf-8).

Leon

Thread Previous | 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