|
Manpages MIME::WordsSection: User Contributed Perl Documentation (3)Updated: perl v5.6.1 Index Return to Main Contents NAMEMIME::Words - deal with RFC-1522 encoded wordsSYNOPSISBefore reading further, you should see the MIME::Tools manpage to make sure that you understand where this module fits into the grand scheme of things. Go on, do it now. I'll wait.Ready? Ok...
use MIME::Words qw(:all);
### Decode the string into another string, forgetting the charsets:
$decoded = decode_mimewords(
'To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk>',
);
### Split string into array of decoded [DATA,CHARSET] pairs:
@decoded = decode_mimewords(
'To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk>',
);
### Encode a single unsafe word:
$encoded = encode_mimeword("\xABFran\xE7ois\xBB");
### Encode a string, trying to find the unsafe words inside it:
$encoded = encode_mimewords("Me and \xABFran\xE7ois\xBB in town");
DESCRIPTIONFellow 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?= <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
NOTESExports its principle functions by default, in keeping with MIME::Base64 and MIME::QuotedPrint.AUTHOREryq (eryq@zeegee.com), ZeeGee Software Inc (http://www.zeegee.com).All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Thanks also to...
Kent Boortz For providing the idea, and the baseline
RFC-1522-decoding code!
KJJ at PrimeNet For requesting that this be split into
its own module.
Stephane Barizien For reporting a nasty bug.
VERSION$Revision: 5.404 $ $Date: 2000/11/10 16:45:12 $
IndexThis document was created by man2html, using the manual pages. Time: 20:33:25 GMT, February 09, 2026 |