The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Email::MIME::RFC2047::Decoder - Decoding of non-ASCII MIME headers

SYNOPSIS

 use Email::MIME::RFC2047::Decoder;
 
 my $decoder = Email::MIME::RFC2047::Decoder->new();
 
 my $string = $decoder->decode_text($encoded_text);
 my $string = $decoder->decode_phrase($encoded_phrase);

DESCRIPTION

This module decodes parts of MIME email message headers containing non-ASCII text according to RFC 2047.

CONSTRUCTOR

new

 my $decoder = Email::MIME::RFC2047::Decoder->new();

Creates a new decoder object.

METHODS

decode_text

 my $string = $decoder->decode_text($encoded_text);

Decodes any MIME header field for which the field body is defined as '*text' (as defined by RFC 822), for example, any Subject or Comments header field.

The resulting string is trimmed and any whitespace is collapsed.

decode_phrase

 my $string = $decoder->decode_phrase($encoded_phrase);

Decodes any 'phrase' token (as defined by RFC 822) in a MIME header field, for example, one that precedes an address in a From, To, or Cc header.

This method works like decode_text but additionally unquotes any 'quoted-strings'.

AUTHOR

Nick Wellnhofer <wellnhofer@aevum.de>

COPYRIGHT AND LICENSE

Copyright (C) Nick Wellnhofer, 2009

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.0 or, at your option, any later version of Perl 5 you may have available.