From 29d54f0db8dd7268eb502cbf8051fa39fda05663 Mon Sep 17 00:00:00 2001 From: cjwatson <> Date: Sat, 9 Apr 2005 14:41:22 -0800 Subject: [PATCH] [project @ 2005-04-09 15:41:22 by cjwatson] Add Debbugs::MIME::encode_rfc1522 function as a partner to decode_rfc1522. --- Debbugs/MIME.pm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Debbugs/MIME.pm b/Debbugs/MIME.pm index 7613e195..d65a69b3 100644 --- a/Debbugs/MIME.pm +++ b/Debbugs/MIME.pm @@ -8,7 +8,7 @@ use vars qw($VERSION @EXPORT_OK); BEGIN { $VERSION = 1.00; - @EXPORT_OK = qw(parse decode_rfc1522); + @EXPORT_OK = qw(parse decode_rfc1522 encode_rfc1522); } use File::Path; @@ -18,6 +18,9 @@ use MIME::Parser; use MIME::WordDecoder qw(); use Unicode::MapUTF8 qw(to_utf8 utf8_supported_charset); +# for encode_rfc1522 +use MIME::Words qw(); + sub getmailbody ($); sub getmailbody ($) { @@ -134,4 +137,11 @@ sub decode_rfc1522 ($) return MIME::WordDecoder::unmime($string); } +sub encode_rfc1522 ($) +{ + my ($string) = @_; + + return MIME::Words::encode_mimewords($string, Charset => 'UTF-8'); +} + 1; -- 2.39.5