Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

TorgoX (1933)


"Il est beau comme la retractilité des serres des oiseaux rapaces [...] et surtout, comme la rencontre fortuite sur une table de dissection d'une machine à coudre et d'un parapluie !" -- Lautréamont

Journal of TorgoX (1933)

Monday June 16, 2003
04:53 AM

improved RSS for

[ #12873 ]
Dear All,

In a fit of activity, I whipped up some code so that the RSS feeds at will do MIME-decoding, so that in the perl.copenhagen archives for example, you get "Næste møde" (Næste møde) instead of "=?iso-8859-1?Q?N=E6ste_m=F8de?=" in the XML. Me and Robert will get this working for the HTML views soon too.

For future reference, the magic I used was doing use Encode qw/decode/; use utf8; and then with a value in $_, ...

if( m/=?/ ) {
  s/\?unknown-8bit\?/?iso-8859-1?/gs; # our best bet
  eval {
    # trap exceptions from unknown encodings
    my $x = decode( 'MIME-Header', $_);
    $_ = $x if utf8::valid($x);

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.