diff options
| author | fukachan <fukachan> | 2001-03-26 11:41:08 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-03-26 11:41:08 +0000 |
| commit | 87ac82fb0efdd291ac8de20c2e6a33a7061c819c (patch) | |
| tree | cec6ed12dd6e31595ca0a4b3cb2e135d14c4d61e /fml/lib | |
| parent | 617fb21dfdeb5a53b421376358e6babdef2ccd59 (diff) | |
| download | fml8-87ac82fb0efdd291ac8de20c2e6a33a7061c819c.tar.gz fml8-87ac82fb0efdd291ac8de20c2e6a33a7061c819c.tar.bz2 fml8-87ac82fb0efdd291ac8de20c2e6a33a7061c819c.zip | |
preserve \s+ in the string to MIME encode
Diffstat (limited to 'fml/lib')
| -rw-r--r-- | fml/lib/FML/MIME.pm | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/fml/lib/FML/MIME.pm b/fml/lib/FML/MIME.pm index 75e15032..43af8322 100644 --- a/fml/lib/FML/MIME.pm +++ b/fml/lib/FML/MIME.pm @@ -86,6 +86,27 @@ by $options->{ charset }. sub encode_mime_string { my ($str, $options) = @_; + my $buf = ''; # return buffer + my $p = 0; + my $pp = 0; + + while ($str) { + if ($str =~ /^(\S+)/) { + $buf .= _encode_mime_string($1, $options); + $str =~ s/^(\S+)//; + } + elsif ($str =~ /^(\s+)/) { + $buf .= $1; + $str =~ s/^(\s+)//; + } + } + + return $buf; +} + +sub _encode_mime_string +{ + my ($str, $options) = @_; my $charset = $options->{ 'charset' } || 'iso-2022-jp'; my $encode = $options->{ 'encode' } || 'base64'; my $header = '=?'. $charset; |
