]> git.donarmstrong.com Git - debbugs.git/commitdiff
[project @ 2005-04-09 15:41:22 by cjwatson]
authorcjwatson <>
Sat, 9 Apr 2005 22:41:22 +0000 (14:41 -0800)
committercjwatson <>
Sat, 9 Apr 2005 22:41:22 +0000 (14:41 -0800)
Add Debbugs::MIME::encode_rfc1522 function as a partner to decode_rfc1522.

Debbugs/MIME.pm

index 7613e1953880264b85610f9751e992c1ed8c2d61..d65a69b3dcae6ffb8560c01d1a453d028a2124ee 100644 (file)
@@ -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;