From: cjwatson <> Date: Sat, 9 Apr 2005 22:41:22 +0000 (-0800) Subject: [project @ 2005-04-09 15:41:22 by cjwatson] X-Git-Tag: release/2.6.0~731 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=29d54f0db8dd7268eb502cbf8051fa39fda05663;p=debbugs.git [project @ 2005-04-09 15:41:22 by cjwatson] Add Debbugs::MIME::encode_rfc1522 function as a partner to decode_rfc1522. --- 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;