procmail
[Top] [All Lists]

Re: Dekoding eight-bit characters in headers

1997-05-08 12:41:00
Philip Guenther writes on 19 April 1997 at 18:55:26
Robin S Socha <uzs8kb(_at_)uni-bonn(_dot_)de> writes:
On Fri, 18 Apr 1997, Philip Guenther wrote:
I seem to be one of the lucky few that never get to enjoy the interesting
recipes ;-/

 >If you don't have libwww, just perl5, then the following _should_ work:
[...]
   :0 fh
   * =\?ISO-8859-[0-9]+\?Q\?
   |perl -pe 's#=\?ISO-8859-\d+\?Q\?(.*?)\?=#$s=$1; $s=~s/\s+(\r?\n)/$1/g;' \
         -e '$s=~s/=\r?\n//g; $s=~s/=([\da-fA-F]{2})/pack("C", hex($1))/ge;' \
         -e '$s#ge;'

Blech!  This is a downright *ugly* bit of code.  Seems to me like a
"formail" option is the best place to deal with this, although I can
see that adding smarts about charsets and the like could add a fair
amount of overhead.

   Dan
------------------- message is author's opinion only ------------------
J. Daniel Smith <DanS(_at_)bristol(_dot_)com>        
http://www.bristol.com/~DanS
Bristol Technology B.V.                   +31 33 450 50 50, ...51 (FAX)
Amersfoort, The Netherlands               {info,jobs}(_at_)bristol(_dot_)com

<Prev in Thread] Current Thread [Next in Thread>