Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

MIME::AltWords0
copy of MIME::Words

MIME::AltWords0 - copy of MIME::Words


NAME

MIME::AltWords0 - copy of MIME::Words (not for direct use)


SYNOPSIS

the MIME::AltWords0 manpage is an auxilary package used by the MIME::AltWords manpage.

If you want to encode or decode MIME words (such as =?ISO-8859-2?Q?_=E1ll_e=E1r?=) found in e-mail message headers (mostly Subject, From and To), the recommended Perl module to use is the MIME::AltWords manpage. Please don't use the MIME::AltWords0 manpage (which is useless by itself anyway) or the MIME::Words manpage (version 5.420 has several serious bugs both with encoding and decoding).

Most users shouldn't read on, but they should read the MIME::AltWords manpage instead.


DESCRIPTION

The following functions have been moved to the MIME::AltWords manpage: decode_mimewords() (some code stays here as decode_mimewords_wantarray()),


    use MIME::AltWords0 qw(:all);   

     

    ### Split string into array of decoded [DATA,CHARSET] pairs:

    @decoded = decode_mimewords_wantarray(

          'To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk>',

          );

     

Fellow Americans, you probably won't know what the hell this module

is for.  Europeans, Russians, et al, you probably do.  C<:-)>.

For example, here's a valid MIME header you might get:


      From: =?US-ASCII?Q?Keith_Moore?= <moore@cs.utk.edu>

      To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk>

      CC: =?ISO-8859-1?Q?Andr=E9_?= Pirard <PIRARD@vm1.ulg.ac.be>

      Subject: =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=

       =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=

       =?US-ASCII?Q?.._cool!?=

The fields basically decode to (sorry, I can only approximate the Latin characters with 7 bit sequences /o and 'e):


      From: Keith Moore <moore@cs.utk.edu>

      To: Keld J/orn Simonsen <keld@dkuug.dk>

      CC: Andr'e  Pirard <PIRARD@vm1.ulg.ac.be>

      Subject: If you can read this you understand the example... cool!


PUBLIC INTERFACE

decode_mimewords_wantarray ENCODED, [OPTS...]
Function. Go through the string looking for RFC-1522-style ``Q'' (quoted-printable, sort of) or ``B'' (base64) encoding, and decode them.

In an array context, splits the ENCODED string into a list of decoded [DATA, CHARSET] pairs, and returns that list. Unencoded data are returned in a 1-element array [DATA], giving an effective CHARSET of undef.


    $enc = '=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk>';

    foreach (decode_mimewords($enc)) {

        print "", ($_[1] || 'US-ASCII'), ": ", $_[0], "\n";

    }

In a scalar context, the result is undocumented, please see decode_mimewords in the MIME::AltWords manpage instead.

In the event of a syntax error, $@ will be set to a description of the error, but parsing will continue as best as possible (so as to get something back when decoding headers). $@ will be false if no error was detected.

Any arguments past the ENCODED string are taken to define a hash of options:

Field
Name of the mail field this string came from. Currently ignored.

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy