Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Contact Us
Online Help
Domain Status
Man Pages

Virtual Servers

Topology Map

Server Agreement
Year 2038

USA Flag



Man Pages

Manual Reference Pages  -  MIME::ALTWORDS0 (3)

.ds Aq ’


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



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

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 MIME::AltWords. Please don’t use MIME::AltWords0 (which is useless by itself anyway) or MIME::Words (version 5.420 has several serious bugs both with encoding and decoding).

Most users shouldn’t read on, but they should read MIME::AltWords instead.


The following functions have been moved to MIME::AltWords: 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?= <>,

Fellow Americans, you probably won’t know what the hell this module is for. Europeans, Russians, et al, you probably do. :-).

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

      From: =?US-ASCII?Q?Keith_Moore?= <>
      To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <>
      CC: =?ISO-8859-1?Q?Andr=E9_?= Pirard <>
      Subject: =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=

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

      From: Keith Moore <>
      To: Keld J/orn Simonsen <>
      CC: Andre  Pirard <>
      Subject: If you can read this you understand the example... cool!


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.

<B>In an array context,B> 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?= <>;
    foreach (decode_mimewords($enc)) {
        print "", ($_[1] || US-ASCII), ": ", $_[0], "\n";

<B>In a scalar context,B> the result is undocumented, please see decode_mimewords in MIME::AltWords 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.


Hey! <B>The above document had some coding errors, which are explained below:B>
Around line 60: =over without closing =back
Around line 353: Non-ASCII character seen before =encoding in ’Pe\k:'Assuming UTF-8
Search for    or go to Top of page |  Section 3 |  Main Index

perl v5.20.3 MIME::ALTWORDS0 (3) 2007-06-11

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.