(Dangitall, if 7-bit ASCII was good enough for Fidonet, it ought to be good enough for email. Kids these days.)

I'm getting this when I try to retrieve
$SomeEmailMimeMessage->header('subject'):

Unknown encoding "X-UNKNOWN" at /usr/lib/perl/5.8/Encode.pm line 166

A fair cop, the subject line *does* go all "=?X-UNKNOWN?Q?Re=3A_" and some junk. In weird cases like this I just want to preserve it as is, so I go to Encode to see how best to tell it to ignore crazy talk.

Hmm. Encode's POD sez ignoring it is default behavior already. But it also sez, it sez:

"Some encodings ignore CHECK argument. For example, Encode::Unicode ignores CHECK and it always croaks on error."

Well, crud. But here's the funky thing, that I'm not quite getting: it's not happening when I *create* $SomeEmailMimeMessage. I could deal with that. It's happening when I *look* at that header. Why is that, and how can I trap it (or ideally, detect it when I first load up the message)?

Or should I not be handing Email::MIME something that's gone through encode('unicode', $mailstring) at all? It's mail that was improperly stored in an SQL-ASCII database, and is going into a UNICODE database, so it's a one-time conversion utility on what may well be lightly-fried data. If this is something that's never going to come up on fresh mail, I can code for the finite number of exceptions in this database.

Reply via email to