ports/113365: new port mail/p5-MIME-EncWords

Olivier Girard Olivier.Girard at univ-angers.fr
Tue Jun 5 13:40:20 UTC 2007


>Number:         113365
>Category:       ports
>Synopsis:       new port mail/p5-MIME-EncWords
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jun 05 13:40:20 GMT 2007
>Closed-Date:
>Last-Modified:
>Originator:     Olivier Girard
>Release:        FreeBSD 6.2-RELEASE-p4 i386
>Organization:
University of Angers, France.
>Environment:
System: FreeBSD tfbsd.uang 6.2-RELEASE-p4 FreeBSD 6.2-RELEASE-p4 #0: Thu 
Apr 26 17:40:53 UTC 2007 
root at i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386

>Description:
MIME::EncWords - deal with RFC-1522 encoded words (improved)

This package is required to update mail/sympa5 to current version.

>How-To-Repeat:
	
>Fix:

	

--- p5-MIME-EncWords.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	p5-MIME-EncWords
#	p5-MIME-EncWords/Makefile
#	p5-MIME-EncWords/distinfo
#	p5-MIME-EncWords/pkg-descr
#	p5-MIME-EncWords/work
#	p5-MIME-EncWords/work/MIME-EncWords-0.040
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/ARTISTIC
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/Changes
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/EncWords.pm
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/GPL
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/MANIFEST
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/META.yml
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/Makefile.PL
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/README
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/t
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/t/01decode.t
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/t/02encode.t
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/testin
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/testin/decode-singlebyte.txt
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/testin/encode-singlebyte.txt
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/Makefile
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/blib
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/MIME
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/MIME/.exists
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/MIME/EncWords.pm
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/auto
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/auto/MIME
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/auto/MIME/EncWords
# 
p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/auto/MIME/EncWords/.exists
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/arch
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/arch/.exists
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/arch/auto
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/arch/auto/MIME
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/arch/auto/MIME/EncWords
# 
p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/arch/auto/MIME/EncWords/.exists
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/bin
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/bin/.exists
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/script
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/script/.exists
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/man1
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/man1/.exists
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/man3
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/man3/.exists
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/man3/MIME::EncWords.3
#	p5-MIME-EncWords/work/MIME-EncWords-0.040/pm_to_blib
#	p5-MIME-EncWords/work/.extract_done.MIME-EncWords._var_tmp_MIME-EncWords
#	p5-MIME-EncWords/work/.patch_done.MIME-EncWords._var_tmp_MIME-EncWords
#	p5-MIME-EncWords/work/.configure_done.MIME-EncWords._var_tmp_MIME-EncWords
#	p5-MIME-EncWords/work/.build_done.MIME-EncWords._var_tmp_MIME-EncWords
#	p5-MIME-EncWords/work/.PLIST.mktmp
#	p5-MIME-EncWords/work/.PLIST.flattened
#	p5-MIME-EncWords/work/.PLIST.setuid
#	p5-MIME-EncWords/work/.PLIST.writable
#	p5-MIME-EncWords/work/.PLIST.objdump
#	p5-MIME-EncWords/work/.install_done.MIME-EncWords._var_tmp_MIME-EncWords
#	p5-MIME-EncWords/pkg-plist
#
echo c - p5-MIME-EncWords
mkdir -p p5-MIME-EncWords > /dev/null 2>&1
echo x - p5-MIME-EncWords/Makefile
sed 's/^X//' >p5-MIME-EncWords/Makefile << 
'END-of-p5-MIME-EncWords/Makefile'
X# New ports collection makefile for:	mail/p5-MIME-EncWords
X# Date created:				05 June 2007
X# Whom:					Olivier Girard <Olivier.Girard at univ-angers.fr>
X#
X# $FreeBSD:$
X#
X
XPORTNAME=	MIME-EncWords
XPORTVERSION=	0.040
XCATEGORIES=	mail perl5
XMASTER_SITES=	${MASTER_SITE_PERL_CPAN}
XMASTER_SITE_SUBDIR=	MIME
XPKGNAMEPREFIX=	p5-
X
XMAINTAINER=	Olivier.Girard at univ-angers.fr
XCOMMENT=	MIME::EncWords - deal with RFC-1522 encoded words (improved)
X
XBUILD_DEPENDS= 
${SITE_PERL}/MIME/Charset.pm:${PORTSDIR}/mail/p5-MIME-Charset \
X		${SITE_PERL}/MIME/Body.pm:${PORTSDIR}/mail/p5-MIME-Tools
XRUN_DEPENDS=    ${BUILD_DEPENDS}
X
XPERL_CONFIGURE=	yes
X
XMAN3=		\
X		MIME::EncWords.3
X
X.include <bsd.port.mk>
END-of-p5-MIME-EncWords/Makefile
echo x - p5-MIME-EncWords/distinfo
sed 's/^X//' >p5-MIME-EncWords/distinfo << 
'END-of-p5-MIME-EncWords/distinfo'
XMD5 (MIME-EncWords-0.040.tar.gz) = b208f410f6a93eface5e34d4c88105e8
XSHA256 (MIME-EncWords-0.040.tar.gz) = 
3b355d59154c5e7c4ea3cba9fff6577645b189c6176a9dd90c1f3bdddae0be54
XSIZE (MIME-EncWords-0.040.tar.gz) = 21869
END-of-p5-MIME-EncWords/distinfo
echo x - p5-MIME-EncWords/pkg-descr
sed 's/^X//' >p5-MIME-EncWords/pkg-descr << 
'END-of-p5-MIME-EncWords/pkg-descr'
XMIME::EncWords is aimed to be another implimentation of MIME::Words so
X    that it will achive more exact conformance with MIME specifications.
X    Additionally, it contains some improvements. Following synopsis and
X    descriptions are inherited from its inspirer, with description of
X    improvements and clarifications added.*
X
X
XAuthor: <hatuka at nezumi.nu>
XWWW: http://search.cpan.org/dist/MIME-EncWords/
END-of-p5-MIME-EncWords/pkg-descr
echo c - p5-MIME-EncWords/work
mkdir -p p5-MIME-EncWords/work > /dev/null 2>&1
echo c - p5-MIME-EncWords/work/MIME-EncWords-0.040
mkdir -p p5-MIME-EncWords/work/MIME-EncWords-0.040 > /dev/null 2>&1
echo x - p5-MIME-EncWords/work/MIME-EncWords-0.040/ARTISTIC
sed 's/^X//' >p5-MIME-EncWords/work/MIME-EncWords-0.040/ARTISTIC << 
'END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/ARTISTIC'
XThe "Artistic License"
X
X  Preamble
X
X   The intent of this document is to state the conditions under which a
X   Package may be copied, such that the Copyright Holder maintains some
X   semblance of artistic control over the development of the package,
X   while giving the users of the package the right to use and distribute
X   the Package in a more-or-less customary fashion, plus the right to
X   make reasonable modifications.
X
X  Definitions
X
X     "Package" refers to the collection of files distributed by the
X     Copyright Holder, and derivatives of that collection of files
X     created through textual modification.
X
X     "Standard Version" refers to such a Package if it has not been
X     modified, or has been modified in accordance with the wishes of the
X     Copyright Holder as specified below.
X
X     "Copyright Holder" is whoever is named in the copyright or
X     copyrights for the package.
X
X     "You" is you, if you're thinking about copying or distributing this
X     Package.
X
X     "Reasonable copying fee" is whatever you can justify on the basis
X     of media cost, duplication charges, time of people involved, and so
X     on. (You will not be required to justify it to the Copyright
X     Holder, but only to the computing community at large as a market
X     that must bear the fee.)
X
X     "Freely Available" means that no fee is charged for the item
X     itself, though there may be fees involved in handling the item. It
X     also means that recipients of the item may redistribute it under
X     the same conditions they received it.
X
X    1. You may make and give away verbatim copies of the source form of
X       the Standard Version of this Package without restriction, provided
X       that you duplicate all of the original copyright notices and
X       associated disclaimers.
X    2. You may apply bug fixes, portability fixes and other modifications
X       derived from the Public Domain or from the Copyright Holder. A
X       Package modified in such a way shall still be considered the
X       Standard Version.
X    3. You may otherwise modify your copy of this Package in any way,
X       provided that you insert a prominent notice in each changed file
X       stating how and when you changed that file, and provided that you
X       do at least ONE of the following:
X
X    a. place your modifications in the Public Domain or otherwise make
X       them Freely Available, such as by posting said modifications to
X       Usenet or an equivalent medium, or placing the modifications on a
X       major archive site such as uunet.uu.net, or by allowing the
X       Copyright Holder to include your modifications in the Standard
X       Version of the Package.
X    b. use the modified Package only within your corporation or
X       organization.
X    c. rename any non-standard executables so the names do not conflict
X       with standard executables, which must also be provided, and
X       provide a separate manual page for each non-standard executable
X       that clearly documents how it differs from the Standard Version.
X    d. make other distribution arrangements with the Copyright Holder.
X
X     You may distribute the programs of this Package in object code or
X   executable form, provided that you do at least ONE of the following:
X
X    a. distribute a Standard Version of the executables and library
X       files, together with instructions (in the manual page or
X       equivalent) on where to get the Standard Version.
X    b. accompany the distribution with the machine-readable source of the
X       Package with your modifications.
X    c. give non-standard executables non-standard names, and clearly
X       document the differences in manual pages (or equivalent), together
X       with instructions on where to get the Standard Version.
X    d. make other distribution arrangements with the Copyright Holder.
X
X     You may charge a reasonable copying fee for any distribution of this
X   Package. You may charge any fee you choose for support of this
X   Package. You may not charge a fee for this Package itself. However,
X   you may distribute this Package in aggregate with other (possibly
X   commercial) programs as part of a larger (possibly commercial)
X   software distribution provided that you do not advertise this Package
X   as a product of your own. You may embed this Package's interpreter
X   within an executable of yours (by linking); this shall be construed as
X   a mere form of aggregation, provided that the complete Standard
X   Version of the interpreter is so embedded.
X
X     The scripts and library files supplied as input to or produced as
X   output from the programs of this Package do not automatically fall
X   under the copyright of this Package, but belong to whomever generated
X   them, and may be sold commercially, and may be aggregated with this
X   Package. If such scripts or library files are aggregated with this
X   Package via the so-called "undump" or "unexec" methods of producing a
X   binary executable image, then distribution of such an image shall
X   neither be construed as a distribution of this Package nor shall it
X   fall under the restrictions of Paragraphs 3 and 4, provided that you
X   do not represent such an executable image as a Standard Version of
X   this Package.
X
X     C subroutines (or comparably compiled subroutines in other
X   languages) supplied by you and linked into this Package in order to
X   emulate subroutines and variables of the language defined by this
X   Package shall not be considered part of this Package, but are the
X   equivalent of input as in Paragraph 6, provided these subroutines do
X   not change the language in any way that would cause it to fail the
X   regression tests for the language.
X
X     Aggregation of this Package with a commercial distribution is always
X   permitted provided that the use of this Package is embedded; that is,
X   when no overt attempt is made to make this Package's interfaces
X   visible to the end user of the commercial distribution. Such use shall
X   not be construed as a distribution of this Package.
X
X     The name of the Copyright Holder may not be used to endorse or
X   promote products derived from this software without specific prior
X   written permission.
X
X     THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
X   WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
X   MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
X
X                                  The End
END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/ARTISTIC
echo x - p5-MIME-EncWords/work/MIME-EncWords-0.040/Changes
sed 's/^X//' >p5-MIME-EncWords/work/MIME-EncWords-0.040/Changes << 
'END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/Changes'
X2006-11-16	Hatuka*nezumi - IKEDA Soji	<hatuka at nezumi.nu>
X
X	* Release 0.040.
X	* encode_mimewords(): New option 'Minimal' to control
X	  minimal encoding behavior.
X	  NOTE: Default behavior was changed from "NO" to "YES".
X
X2006-10-22	Hatuka*nezumi - IKEDA Soji	<hatuka at nezumi.nu>
X
X	* Release 0.032.
X	* More documentation changes.
X
X2006-10-20	Hatuka*nezumi - IKEDA Soji	<hatuka at nezumi.nu>
X
X	* Release 0.03.1 (not really released).
X	* Documentation changes only: Note on modifications, clarifications
X	  about compatibility with MIME::Words.
X
X2006-10-17	Hatuka*nezumi - IKEDA Soji	<hatuka at nezumi.nu>
X
X	* Release 0.03.
X	* decode_mimewords: allow Unicode input.
X	* decode_mimewords: don't collapse spaces between '?='...'=?'.
X	* Bug fix: cannot encode null string.
X	* Handle wide characters exactly.
X	* Change die to croak.
X
X2006-10-13	Hatuka*nezumi - IKEDA Soji	<hatuka at nezumi.nu>
X
X	* Release 0.02.
X	* decode_mimewords: Fix bug about default charset.
X	* Supports Perl 5.005 or later.
X	  Unicode/multibyte handling will be enabled on Perl 5.8.1 or later.
X	* Added test cases for encode_mimewords (only for singlebyte).
X
X2006-10-11	Hatuka*nezumi - IKEDA Soji	<hatuka at nezumi.nu>
X
X	* Release 0.01; Initial CPAN upload.
END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/Changes
echo x - p5-MIME-EncWords/work/MIME-EncWords-0.040/EncWords.pm
sed 's/^X//' >p5-MIME-EncWords/work/MIME-EncWords-0.040/EncWords.pm << 
'END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/EncWords.pm'
X
Xpackage MIME::EncWords;
Xuse 5.005;
X
X=head1 NAME
X
XMIME::EncWords - deal with RFC-1522 encoded words (improved)
X
X=head1 SYNOPSIS
X
XI<L<MIME::EncWords> is aimed to be another implimentation
Xof L<MIME::Words> so that it will achive more exact conformance with
XMIME specifications.  Additionally, it contains some improvements.
XFollowing synopsis and descriptions are inherited from its inspirer,
Xwith description of improvements and clarifications added.>
X
XBefore reading further, you should see L<MIME::Tools> to make sure that
Xyou understand where this module fits into the grand scheme of things.
XGo on, do it now.  I'll wait.
X
XReady?  Ok...
X
X    use MIME::EncWords qw(:all);
X
X    ### Decode the string into another string, forgetting the charsets:
X    $decoded = decode_mimewords(
X          'To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld at dkuug.dk>',
X          );
X
X    ### Split string into array of decoded [DATA,CHARSET] pairs:
X    @decoded = decode_mimewords(
X          'To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld at dkuug.dk>',
X          );
X
X    ### Encode a single unsafe word:
X    $encoded = encode_mimeword("\xABFran\xE7ois\xBB");
X
X    ### Encode a string, trying to find the unsafe words inside it:
X    $encoded = encode_mimewords("Me and \xABFran\xE7ois\xBB in town");
X
X=head1 DESCRIPTION
X
XFellow Americans, you probably won't know what the hell this module
Xis for.  Europeans, Russians, et al, you probably do.  C<:-)>.
X
XFor example, here's a valid MIME header you might get:
X
X      From: =?US-ASCII?Q?Keith_Moore?= <moore at cs.utk.edu>
X      To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld at dkuug.dk>
X      CC: =?ISO-8859-1?Q?Andr=E9_?= Pirard <PIRARD at vm1.ulg.ac.be>
X      Subject: =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=
X       =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=
X       =?US-ASCII?Q?.._cool!?=
X
XThe fields basically decode to (sorry, I can only approximate the
XLatin characters with 7 bit sequences /o and 'e):
X
X      From: Keith Moore <moore at cs.utk.edu>
X      To: Keld J/orn Simonsen <keld at dkuug.dk>
X      CC: Andr'e  Pirard <PIRARD at vm1.ulg.ac.be>
X      Subject: If you can read this you understand the example... cool!
X
XB<Supplement>: Fellow Americans, Europeans, you probably won't know
Xwhat the hell this module is for.  East Asians, et al, you probably do.
XC<:-)>.
X
XFor example, here's a valid MIME header you might get:
X
X      Subject: =?EUC-KR?B?sNTAuLinKGxhemluZXNzKSwgwvzB9ri7seIoaW1w?=
X       =?EUC-KR?B?YXRpZW5jZSksILGzuLgoaHVicmlzKQ==?=
X
XThe fields basically decode to (sorry, I cannot approximate the
Xnon-Latin multibyte characters with any 7 bit sequences):
X
X      Subject: ???(laziness), ????(impatience), ??(hubris)
X
X=head1 PUBLIC INTERFACE
X
X=over 4
X
X=cut
X
X### Pragmas:
Xuse strict;
Xuse vars qw($VERSION @EXPORT_OK %EXPORT_TAGS @ISA);
X
X### Exporting:
Xuse Exporter;
X
X%EXPORT_TAGS = (all => [qw(decode_mimewords
X			   encode_mimeword
X			   encode_mimewords)]);
XExporter::export_ok_tags(qw(all));
X
X### Inheritance:
X at ISA = qw(Exporter);
X
X### Other modules:
Xuse Carp;
Xuse MIME::Base64;
Xuse MIME::Charset qw(:trans);
X
Xmy @ENCODE_SUBS = qw(FB_CROAK decode encode from_to is_utf8 resolve_alias);
Xif (MIME::Charset::USE_ENCODE) {
X    eval "use ".MIME::Charset::USE_ENCODE." \@ENCODE_SUBS;";
X} else {
X    require MIME::Charset::_Compat;
X    for my $sub (@ENCODE_SUBS) {
X        no strict "refs";
X        *{$sub} = \&{"MIME::Charset::_Compat::$sub"};
X    }
X}
X
X#------------------------------
X#
X# Globals...
X#
X#------------------------------
X
X### The package version, both in 1.23 style *and* usable by MakeMaker:
X$VERSION = '0.040';
X
X### Nonprintables (controls + x7F + 8bit):
X#my $NONPRINT = "\\x00-\\x1F\\x7F-\\xFF";
Xmy $PRINTABLE = "\\x21-\\x7E";
Xmy $NONPRINT = qr{[^$PRINTABLE]}; # Improvement: Unicode support.
Xmy $UNSAFE = qr{[^\x01-\x20$PRINTABLE]};
Xmy $WIDECHAR = qr{[^\x00-\xFF]};
X
X### Max line length:
Xmy $MAXLINELEN = 76;
X
X#------------------------------
X
X# _decode_B STRING
X#     Private: used by _decode_header() to decode "B" encoding.
X#     Improvement by this module: sanity check on encoded sequence.
Xsub _decode_B {
X    my $str = shift;
X    unless ((length($str) % 4 == 0) and
X	$str =~ m|^[A-Za-z0-9+/]+={0,2}$|) {
X	return undef;
X    }
X    return decode_base64($str);
X}
X
X# _decode_Q STRING
X#     Private: used by _decode_header() to decode "Q" encoding, which is
X#     almost, but not exactly, quoted-printable.  :-P
Xsub _decode_Q {
X    my $str = shift;
X    $str =~ s/_/\x20/g;					# RFC-1522, Q rule 2
X    $str =~ s/=([\da-fA-F]{2})/pack("C", hex($1))/ge;	# RFC-1522, Q rule 1
X    $str;
X}
X
X# _encode_B STRING
X#     Private: used by encode_mimeword() to encode "B" encoding.
Xsub _encode_B {
X    my $str = shift;
X    encode_base64($str, '');
X}
X
X# _encode_Q STRING
X#     Private: used by encode_mimeword() to encode "Q" encoding, which is
X#     almost, but not exactly, quoted-printable.  :-P
X#     Improvement by this module: Spaces are escaped by ``_''.
Xsub _encode_Q {
X    my $str = shift;
X    # $str =~ s{([_\?\=$NONPRINT])}{sprintf("=%02X", ord($1))}eog;
X    $str =~ s{(\x20)|([_?=]|$NONPRINT)}{
X	defined $1? "_": sprintf("=%02X", ord($2))
X	}eog;
X    $str;
X}
X
X#------------------------------
X
X=item decode_mimewords ENCODED, [OPTS...]
X
XI<Function.>
XGo through the string looking for RFC-1522-style "Q"
X(quoted-printable, sort of) or "B" (base64) encoding, and decode them.
X
XB<In an array context,> splits the ENCODED string into a list of decoded
XC<[DATA, CHARSET]> pairs, and returns that list.  Unencoded
Xdata are returned in a 1-element array C<[DATA]>, giving an effective
XCHARSET of C<undef>.
X
X    $enc = '=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld at dkuug.dk>';
X    foreach (decode_mimewords($enc)) {
X        print "", ($_[1] || 'US-ASCII'), ": ", $_[0], "\n";
X    }
X
XB<In a scalar context,> joins the "data" elements of the above
Xlist together, and returns that.  I<Warning: this is information-lossy,>
Xand probably I<not> what you want, but if you know that all charsets
Xin the ENCODED string are identical, it might be useful to you.
X(Before you use this, please see L<MIME::WordDecoder/unmime>,
Xwhich is probably what you want.)
XB<Note>: See also "Charset" option below.
X
XIn the event of a syntax error, $@ will be set to a description
Xof the error, but parsing will continue as best as possible (so as to
Xget I<something> back when decoding headers).
X$@ will be false if no error was detected.
X
XAny arguments past the ENCODED string are taken to define a hash of 
options:
X
X=over 4
X
X=item Charset
X
XB<Improvement by this module>:
XName of character set by which data elements in scalar context
Xwill be converted.
XIf this option is specified as special value C<"_UNICODE_">,
Xreturned value will be Unicode string.
X
XWhen Unicode/multibyte support is disabled
X(see L<MIME::Charset/USE_ENCODE>),
Xthis option will not have any effects.
X
XB<Note>:
XThis feature is still information-lossy, I<except> when C<"_UNICODE_"> is
Xspecified.
X
X=item Field
X
XName of the mail field this string came from.  I<Currently ignored.>
X
X=back
X
XB<Improvement by this module>:
XAdjacent encoded-words with same charset will be concatenated
Xto handle multibyte sequences safely.
X
XB<Change by this module>:
XMalformed base64 encoded-words will be kept encoded.
XIn this case $@ will be set.
X
XB<Compatibility with MIME::Words>:
XWhitespaces surrounding unencoded data will not be stripped.
X
X=cut
X
Xsub decode_mimewords {
X    my $encstr = shift;
X    my %params = @_;
X    my $cset = $params{"Charset"};
X    my @tokens;
X    $@ = '';           ### error-return
X
X    ### Decode:
X    my ($word, $charset, $encoding, $enc, $dec);
X    my $spc = '';
X    pos($encstr) = 0;
X    while (1) {
X        last if (pos($encstr) >= length($encstr));
X        my $pos = pos($encstr);               ### save it
X
X        ### Case 1: are we looking at "=?..?..?="?
X        if ($encstr =~    m{\G             # from where we left off..
X                            =\?([^?]*)     # "=?" + charset +
X                             \?([bq])      #  "?" + encoding +
X                             \?([^?]+)     #  "?" + data maybe with spcs +
X                             \?=           #  "?="
X			     ([\r\n\t ]*)
X                            }xgi) {
X	    ($word, $charset, $encoding, $enc) = ($&, $1, lc($2), $3);
X	    my $tspc = $4;
X	    if ($encoding eq 'q') {
X		$dec = _decode_Q($enc);
X	    } else {
X		$dec = _decode_B($enc);
X	    }
X	    unless (defined $dec) {
X		$@ .= qq|Illegal sequence in "$word" (pos $pos)\n|;
X		push @tokens, [$spc.$word];
X		$spc = '';
X		next;
X	    }
X
X	    if (scalar(@tokens) and
X		lc($charset) eq lc(${$tokens[-1]}[1]) and
X		resolve_alias($charset)) { # Concat words if possible.
X		${$tokens[-1]}[0] .= $dec;
X	    } else {
X		push @tokens, [$dec, $charset];
X	    }
X	    $spc = $tspc;
X            next;
X        }
X
X        ### Case 2: are we looking at a bad "=?..." prefix?
X        ### We need this to detect problems for case 3, which stops at 
"=?":
X        pos($encstr) = $pos;               # reset the pointer.
X        if ($encstr =~ m{\G=\?}xg) {
X            $@ .= qq|unterminated "=?..?..?=" in "$encstr" (pos $pos)\n|;
X            push @tokens, [$spc.'=?'];
X	    $spc = '';
X            next;
X        }
X
X        ### Case 3: are we looking at ordinary text?
X        pos($encstr) = $pos;               # reset the pointer.
X        if ($encstr =~ m{\G                # from where we left off...
X                         (.*?              #   shortest possible string,
X                          \n*)             #   followed by 0 or more NLs,
X                         (?=(\Z|=\?))      # terminated by "=?" or EOS
X                        }xgs) {
X            length($1) or croak "MIME::EncWords: internal logic err: 
empty token\n";
X            push @tokens, [$spc.$1];
X	    $spc = '';
X            next;
X        }
X
X        ### Case 4: bug!
X        croak "MIME::EncWords: unexpected case:\n($encstr) pos $pos\n\t".
X            "Please alert developer.\n";
X    }
X    push @tokens, [$spc] if $spc;
X
X    return (wantarray ? @tokens : join('',map {
X	&_convert($_->[0], $_->[1], $cset)
X	} @tokens));
X}
X
X#------------------------------
X
X# _convert RAW, FROMCHARSET, TOCHARSET
X#     Private: used by encode_mimewords() to convert string by other 
charset
X#     or to decode to Unicode.
X#     When source charset is unknown and Unicode string is requested, 
at first
X#     try well-formed UTF-8 then fallback to ISO-8859-1 so that almost all
X#     non-ASCII bytes will be preserved.
Xsub _convert($$$) {
X    my $s = shift;
X    my $charset = shift || "";
X    my $cset = shift;
X    return $s unless MIME::Charset::USE_ENCODE;
X    return $s unless $cset;
X    return $s if uc($charset) eq uc($cset);
X
X    my $preserveerr = $@;
X
X    my $converted = $s;
X    if (is_utf8($s) or $s =~ $WIDECHAR) {
X	if ($cset ne "_UNICODE_") {
X	    $converted = encode($cset, $converted);
X	}
X    } elsif ($cset eq "_UNICODE_") {
X	if (!resolve_alias($charset)) {
X	    if ($s =~ $UNSAFE) {
X		$@ = '';
X		eval {
X		    $converted = decode("UTF-8", $converted, FB_CROAK());
X		};
X		if ($@) {
X		    $converted = $s;
X		    $converted = decode("ISO-8859-1", $converted);
X		}
X	    }
X	} else {
X	    $converted = decode($charset, $converted);
X	}
X    } elsif (resolve_alias($charset)) {
X	from_to($converted, $charset, $cset);
X    }
X
X    $@ = $preserveerr;
X    return $converted;
X}
X
X#------------------------------
X
X=item encode_mimeword RAW, [ENCODING], [CHARSET]
X
XI<Function.>
XEncode a single RAW "word" that has unsafe characters.
XThe "word" will be encoded in its entirety.
X
X    ### Encode "<<Franc,ois>>":
X    $encoded = encode_mimeword("\xABFran\xE7ois\xBB");
X
XYou may specify the ENCODING (C<"Q"> or C<"B">), which defaults to C<"Q">.
XB<Improvement by this module>:
XYou may also specify it as ``special'' value: C<"S"> to choose shorter
Xone of either C<"Q"> or C<"B">.
X
XYou may specify the CHARSET, which defaults to C<iso-8859-1>.
X
XB<Change by this module>:
XSpaces will be escaped with ``_'' by C<"Q"> encoding.
X
X=cut
X
Xsub encode_mimeword {
X    my $word = shift;
X    my $encoding = uc(shift || 'Q');
X    my $charset  = uc(shift || 'ISO-8859-1');
X
X    my $encstr;
X    if ($encoding eq 'Q') {
X	$encstr = &_encode_Q($word);
X    } elsif ($encoding eq "S") {
X	if (encoded_header_len($word, "B", $charset) <
X	    encoded_header_len($word, "Q", $charset)) {
X	    $encoding = "B";
X	    $encstr = &_encode_B($word);
X	} else {
X	    $encoding = "Q";
X	    $encstr = &_encode_Q($word);
X	}
X    } else { # "B"
X	$encoding = "B";
X	$encstr = &_encode_B($word);
X    }
X
X    "=?$charset?$encoding?$encstr?=";
X}
X
X#------------------------------
X
X=item encode_mimewords RAW, [OPTS]
X
XI<Function.>
XGiven a RAW string, try to find and encode all "unsafe" sequences
Xof characters:
X
X    ### Encode a string with some unsafe "words":
X    $encoded = encode_mimewords("Me and \xABFran\xE7ois\xBB");
X
XReturns the encoded string.
X
XB<Improvement by this module>:
XRAW may be a Unicode string when Unicode/multibyte support is enabled
X(see L<MIME::Charset/USE_ENCODE>).
XFurthermore, RAW may be a reference to that returned
Xby L<"decode_mimewords"> on array context.  In latter case "Charset"
Xoption (see below) will be overridden (see also notes below).
X
XAny arguments past the RAW string are taken to define a hash of options:
X
X=over 4
X
X=item Charset
X
XEncode all unsafe stuff with this charset.  Default is 'ISO-8859-1',
Xa.k.a. "Latin-1".
X
X=item Detect7bit
X
XB<Improvement by this modlue>:
XWhen "Encoding" option (see below) is specified as C<"a"> and "Charset"
Xoption is unknown, try to detect 7-bit charset on given RAW string.
XDefault is C<"YES">.
XWhen Unicode/multibyte support is disabled,
Xthis option will not have any effects
X(see L<MIME::Charset/USE_ENCODE>).
X
X=item Encoding
X
XThe encoding to use, C<"q"> or C<"b">.  The default is C<"q">.
XB<Improvement by this module>:
XYou may also specify ``special'' values: C<"a"> will automatically choose
Xrecommended encoding to use (with charset conversion if alternative
Xcharset is recommended: see L<MIME::Charset>);
XC<"s"> will choose shorter one of either C<"q"> or C<"b">.
X
X=item Field
X
XName of the mail field this string will be used in.
XB<Improvement by this module>:
XLength of mail field name will be considered in the first line of
Xencoded header.
X
X=item Minimal
X
XB<Improvement by this module>:
XTakes care of natural word separators (i.e. whitespaces)
Xin the text to be encoded.
XIf C<"NO"> is specified, this module will encode whole text
X(if encoding needed) not regarding whitespaces;
Xencoded-words exceeding line length will be splitted based only on their
Xlengths.
XDefault is C<"YES">.
X
XB<Note>:
XAs of release 0.040, default has been changed to C<"YES"> to ensure
Xcompatibility with MIME::Words.
XOn earlier releases, this option was fixed to be C<"NO">.
X
X=back
X
XB<Notes on improvement by this module>:
XWhen RAW is an arrayref,
Xadjacent encoded-words are concatenated.  Then they are splitted taking
Xcare of character boundaries of multibyte sequences, when Unicode/multibyte
Xsupport is enabled.
XPortions for unencoded data should include surrounding whitespace(s), or
Xthey will be merged into adjoining encoded word(s).
X
X=cut
X
Xsub encode_mimewords  {
X    my $words = shift;
X    my %params = @_;
X    my $charset = uc($params{'Charset'});
X    my $detect7bit = uc($params{'Detect7bit'} || "YES");
X    my $encoding = uc($params{'Encoding'});
X    my $header_name = $params{'Field'};
X    my $minimal = uc($params{'Minimal'} || "YES");
X    my $firstlinelen = $MAXLINELEN;
X    if ($header_name) {
X	$firstlinelen -= length($header_name.': ');
X    }
X
X    unless (ref($words) eq "ARRAY") {
X	if ($minimal eq "YES") {
X	    my @words = map {[$_, $charset]} split(/((?:\A|[\t ])[\t 
\x21-\x7E]+(?:[\t ]|\Z))/, $words);
X	    $words = \@words;
X	} else {
X	    $words = [[$words, $charset]];
X	}
X    }
X
X    # Translate / concatenate words.
X    my @triplets;
X    foreach (@$words) {
X	my ($s, $cset) = @$_;
X	my $enc;
X
X	next unless length($s);
X
X	# Unicode string should be encoded by given charset.
X	# Unsupported charset will be fallbacked to UTF-8.
X	if (is_utf8($s) or $s =~ $WIDECHAR) {
X	    unless (resolve_alias($cset)) {
X		if ($s !~ $UNSAFE) {
X		    $cset = "US-ASCII";
X		} else {
X		    $cset = "UTF-8";
X		}
X	    }
X	    $s = encode($cset, $s);
X	}
X
X	# Determine charset and encoding.
X	if ($encoding eq "A") {
X	    ($s, $cset, $enc) =
X		header_encode($s, $cset || $charset,
X			      Detect7bit => $detect7bit);
X	} else {
X	    $cset ||= ($charset || ($s !~ $UNSAFE)? "US-ASCII": "ISO-8859-1");
X	    $enc = $encoding ||
X		(($s !~ $UNSAFE and $cset eq "US-ASCII")? undef: "Q");
X	}
X
X	# Concatenate adjacent ``words'' so that multibyte sequences will
X	# be handled safely.
X	# Note: Encoded-word and unencoded text must not adjoin without
X	# separating whitespace(s).
X	if (scalar(@triplets)) {
X	    my ($last, $lastenc, $lastcset) = @{$triplets[-1]};
X	    if (uc($lastcset) eq uc($cset) and uc($lastenc) eq uc($enc) and
X		resolve_alias($cset)) {
X		${$triplets[-1]}[0] .= $s;
X		next;
X	    } elsif (!$lastenc and $enc and $last !~ /[\t ]$/) {
X		if ($last =~ /^(.*)[\t ]([$PRINTABLE]+)$/s) {
X		    ${$triplets[-1]}[0] = $1." ";
X		    $s = $2.$s;
X		} elsif (uc($lastcset) eq "US-ASCII") {
X		    ${$triplets[-1]}[0] .= $s;
X		    ${$triplets[-1]}[1] = $enc;
X		    ${$triplets[-1]}[2] = $cset;
X		    next;
X		}
X	    } elsif ($lastenc and !$enc and $s !~ /^[\t ]/) {
X		if ($s =~ /^([$PRINTABLE]+)[\t ](.*)$/s) {
X		    ${$triplets[-1]}[0] .= $1;
X		    $s = " ".$2;
X		} elsif (uc($cset) eq "US-ASCII") {
X		    ${$triplets[-1]}[0] .= $s;
X		    next;
X		}
X	    }
X	}
X	push @triplets, [$s, $enc, $cset];
X    }
X
X    # Split long ``words''.
X    my @splitted;
X    my $restlen = $firstlinelen;
X    my $lastlen = 0;
X    foreach (@triplets) {
X	my ($s, $enc, $cset) = @$_;
X
X	my $restlen = $restlen - $lastlen - 1;
X	if ($restlen < ($enc? encoded_header_len('', $enc, $cset): 1)) {
X	    $restlen = $MAXLINELEN - 1;
X	}
X
X	push @splitted, &_split($s, $enc, $cset, $restlen);
X	my ($last, $lastenc, $lastcset) = @{$splitted[-1]};
X	if ($lastenc) {
X	    $lastlen = encoded_header_len($last, $lastenc, $lastcset);
X	} else {
X	    $lastlen = length($last);
X	}
X    }
X
X    # Do encoding.
X    my @lines;
X    my $linelen = $firstlinelen;
X    foreach (@splitted) {
X	my ($str, $encoding, $charset) = @$_;
X	next unless length($str);
X
X	my $s;
X	if (!$encoding) {
X	    $s = $str;
X	} else {
X	    $s = &encode_mimeword($str, $encoding, $charset);
X	}
X
X	my $spc = (scalar(@lines) and $lines[-1] =~ /[\t ]$/)? '': ' ';
X	if (!scalar(@lines)) {
X	    $s =~ s/^[\r\n\t ]+//;
X	    push @lines, $s;
X	} elsif (length($lines[-1]) + length($s) <= $linelen) {
X	    $lines[-1] .= $spc.$s;
X	} else {
X	    $s =~ s/^[\r\n\t ]+//;
X	    push @lines, $s;
X	    $linelen = $MAXLINELEN - 1;
X	}
X    }
X
X    join("\n ", @lines);
X}
X
X#------------------------------
X
X# _split RAW, ENCODING, CHARSET, ROOM_OF_FIRST_LINE
X#     Private: used by encode_mimewords() to split a string into
X#     (encoded or non-encoded) words.
X#     Returns an array of arrayrefs [SUBSTRING, ENCODING, CHARSET].
Xsub _split {
X    my $str = shift;
X    my $encoding = shift;
X    my $charset = shift;
X    my $restlen = shift;
X
X    if (!$charset or $charset eq '8BIT') {	# Undecodable.
X	$str =~ s/[\r\n]+[\t ]*|\x00/ /g;	# Eliminate hostile characters.
X	return ([$str, undef, $charset]);
X    }
X    unless (resolve_alias($charset)) {		# Unsupported charset.
X	return ([$str, $encoding, $charset]);
X    }
X    if (!$encoding and $charset eq 'US-ASCII') {
X	return &_split_ascii($str, $restlen);
X    }
X
X    my (@splitted, $ustr, $first);
X    while (length($str)) {
X	if (encoded_header_len($str, $encoding, $charset) <= $restlen) {
X	    push @splitted, [$str, $encoding, $charset];
X	    last;
X	}
X	$ustr = $str;
X	$ustr = decode($charset, $ustr);
X	($first, $str) = &_clip_unsafe($ustr, $encoding, $charset, $restlen);
X	push @splitted, [$first, $encoding, $charset];
X	$restlen = $MAXLINELEN - 1;
X    }
X    return @splitted;
X}
X
X# _split_ascii RAW, ROOM_OF_FIRST_LINE
X#     Private: used by encode_mimewords() to split an US-ASCII string into
X#     (encoded or non-encoded) words.
X#     Returns an array of arrayrefs [SUBSTRING, ENCODING, "US-ASCII"],
X#     where ENCODING is either undef or (if any unsafe sequences are
X#     included) "Q".
Xsub _split_ascii {
X    my $s = shift;
X    my $restlen = shift || $MAXLINELEN - 1;
X
X    my @splitted;
X    foreach my $line (split(/[\r\n]+/, $s)) {
X	$line =~ s/^[\t ]+//;
X
X	if (length($line) < $restlen and $line !~ /=\?|$UNSAFE/) {
X	    push @splitted, [$line, undef, "US-ASCII"];
X	    $restlen = $MAXLINELEN - 1;
X	    next;
X	}
X
X        my ($spc, $enc);
X	foreach my $word (split(/([\t ]+)/, $line)) {
X	    if ($word =~ /[\t ]/) {
X		$spc = $word;
X		next;
X	    }
X
X	    $enc = ($word =~ /=\?|$UNSAFE/)? "Q": undef;
X	    if (scalar(@splitted)) {
X		my ($last, $lastenc, $lastcset) = @{$splitted[-1]};
X		my ($elen, $cont, $appe);
X
X		# Concatenate adjacent words so that encoded-word and
X		# unencoded text will adjoin with separating whitespace.
X		if (!$lastenc and !$enc) {
X		    $elen = length($spc.$word);
X		    ($cont, $appe) = ($spc.$word, "");
X		} elsif (!$lastenc and $enc) {
X		    $elen = length($spc) +
X			encoded_header_len($word, "Q", "US-ASCII");
X		    ($cont, $appe) = ($spc, $word);
X		} elsif ($lastenc and !$enc) {
X		    $elen = length($spc.$word);
X		    ($cont, $appe) = ("", $spc.$word);
X		} else {
X		    $elen = encoded_header_len($spc.$word, "Q",
X					       "US-ASCII") - 15;
X		    ($cont, $appe) = ($spc.$word, "");
X		}
X
X		if ($elen <= $restlen) {
X		    ${$splitted[-1]}[0] .= $cont if length($cont);
X		    push @splitted, [$appe, $enc, "US-ASCII"] if length($appe);
X		    $restlen -= $elen;
X		    next;
X		}
X		$restlen = $MAXLINELEN - 1;
X	    }
X	    push @splitted, [$word, $enc, "US-ASCII"];
X	    $restlen -= ($enc?
X		encoded_header_len($word, "Q", "US-ASCII"):
X		length($word));
X	}
X    }
X    return @splitted;
X}
X
X# _clip_unsafe UNICODE, ENCODING, CHARSET, ROOM_OF_FIRST_LINE
X#     Private: used by encode_mimewords() to bite off one encodable
X#     ``word'' from a Unicode string.
Xsub _clip_unsafe {
X    my $ustr = shift;
X    my $encoding = shift;
X    my $charset = shift;
X    my $restlen = shift;
X    return ("", "") unless length($ustr);
X
X    # Seek maximal division point.
X    my ($shorter, $longer) = (0, length($ustr));
X    while ($shorter < $longer) {
X	my $cur = int(($shorter + $longer + 1) / 2);
X	my $enc = encode($charset, substr($ustr, 0, $cur));
X	my $elen = encoded_header_len($enc, $encoding, $charset);
X	if ($elen <= $restlen) {
X	    $shorter = $cur;
X	} else {
X	    $longer = $cur - 1;
X	}
X    }
X
X    # Make sure that combined characters won't be divided.
X    my ($fenc, $renc);
X    my $max = length($ustr);
X    while (1) {
X	$@ = '';
X	eval {
X	    ($fenc, $renc) =
X		(substr($ustr, 0, $shorter), substr($ustr, $shorter));
X	    $fenc = encode($charset, $fenc, FB_CROAK());
X	    $renc = encode($charset, $renc, FB_CROAK());
X	};
X	last unless ($@);
X
X	$shorter++;
X	unless ($shorter < $max) { # Unencodable characters are included.
X	    return (encode($charset, $ustr), "");
X	}
X    }
X
X    if (length($fenc)) {
X	return ($fenc, $renc);
X    } else {
X	return ($renc, "");
X    }
X}
X
X#------------------------------
X
X=back
X
X=head1 VERSION
X
XConsult $VERSION variable.
X
XDevelopment versions of this module may be found at
XL<http://hatuka.nezumi.nu/repos/MIME-EncWords/>.
X
X=head1 SEE ALSO
X
XL<MIME::Charset>,
XL<MIME::Tools>
X
X=head1 AUTHORS
X
XThe original version of function decode_mimewords() is derived from
XL<MIME::Words> module that was written by:
X    Eryq (F<eryq at zeegee.com>), ZeeGee Software Inc 
(F<http://www.zeegee.com>).
X    David F. Skoll (dfs at roaringpenguin.com) http://www.roaringpenguin.com
X
XOther stuff are rewritten or added by:
X    Hatuka*nezumi - IKEDA Soji <hatuka(at)nezumi.nu>.
X
XAll rights reserved.  This program is free software; you can redistribute
Xit and/or modify it under the same terms as Perl itself.
X
X=cut
X
X1;
END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/EncWords.pm
echo x - p5-MIME-EncWords/work/MIME-EncWords-0.040/GPL
sed 's/^X//' >p5-MIME-EncWords/work/MIME-EncWords-0.040/GPL << 
'END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/GPL'
X		    GNU GENERAL PUBLIC LICENSE
X		       Version 2, June 1991
X
X Copyright (C) 1989, 1991 Free Software Foundation, Inc.
X               59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
X Everyone is permitted to copy and distribute verbatim copies
X of this license document, but changing it is not allowed.
X
X			    Preamble
X
X  The licenses for most software are designed to take away your
Xfreedom to share and change it.  By contrast, the GNU General Public
XLicense is intended to guarantee your freedom to share and change free
Xsoftware--to make sure the software is free for all its users.  This
XGeneral Public License applies to most of the Free Software
XFoundation's software and to any other program whose authors commit to
Xusing it.  (Some other Free Software Foundation software is covered by
Xthe GNU Library General Public License instead.)  You can apply it to
Xyour programs, too.
X
X  When we speak of free software, we are referring to freedom, not
Xprice.  Our General Public Licenses are designed to make sure that you
Xhave the freedom to distribute copies of free software (and charge for
Xthis service if you wish), that you receive source code or can get it
Xif you want it, that you can change the software or use pieces of it
Xin new free programs; and that you know you can do these things.
X
X  To protect your rights, we need to make restrictions that forbid
Xanyone to deny you these rights or to ask you to surrender the rights.
XThese restrictions translate to certain responsibilities for you if you
Xdistribute copies of the software, or if you modify it.
X
X  For example, if you distribute copies of such a program, whether
Xgratis or for a fee, you must give the recipients all the rights that
Xyou have.  You must make sure that they, too, receive or can get the
Xsource code.  And you must show them these terms so they know their
Xrights.
X
X  We protect your rights with two steps: (1) copyright the software, and
X(2) offer you this license which gives you legal permission to copy,
Xdistribute and/or modify the software.
X
X  Also, for each author's protection and ours, we want to make certain
Xthat everyone understands that there is no warranty for this free
Xsoftware.  If the software is modified by someone else and passed on, we
Xwant its recipients to know that what they have is not the original, so
Xthat any problems introduced by others will not reflect on the original
Xauthors' reputations.
X
X  Finally, any free program is threatened constantly by software
Xpatents.  We wish to avoid the danger that redistributors of a free
Xprogram will individually obtain patent licenses, in effect making the
Xprogram proprietary.  To prevent this, we have made it clear that any
Xpatent must be licensed for everyone's free use or not licensed at all.
X
X  The precise terms and conditions for copying, distribution and
Xmodification follow.
X
X		    GNU GENERAL PUBLIC LICENSE
X   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
X
X  0. This License applies to any program or other work which contains
Xa notice placed by the copyright holder saying it may be distributed
Xunder the terms of this General Public License.  The "Program", below,
Xrefers to any such program or work, and a "work based on the Program"
Xmeans either the Program or any derivative work under copyright law:
Xthat is to say, a work containing the Program or a portion of it,
Xeither verbatim or with modifications and/or translated into another
Xlanguage.  (Hereinafter, translation is included without limitation in
Xthe term "modification".)  Each licensee is addressed as "you".
X
XActivities other than copying, distribution and modification are not
Xcovered by this License; they are outside its scope.  The act of
Xrunning the Program is not restricted, and the output from the Program
Xis covered only if its contents constitute a work based on the
XProgram (independent of having been made by running the Program).
XWhether that is true depends on what the Program does.
X
X  1. You may copy and distribute verbatim copies of the Program's
Xsource code as you receive it, in any medium, provided that you
Xconspicuously and appropriately publish on each copy an appropriate
Xcopyright notice and disclaimer of warranty; keep intact all the
Xnotices that refer to this License and to the absence of any warranty;
Xand give any other recipients of the Program a copy of this License
Xalong with the Program.
X
XYou may charge a fee for the physical act of transferring a copy, and
Xyou may at your option offer warranty protection in exchange for a fee.
X
X  2. You may modify your copy or copies of the Program or any portion
Xof it, thus forming a work based on the Program, and copy and
Xdistribute such modifications or work under the terms of Section 1
Xabove, provided that you also meet all of these conditions:
X
X    a) You must cause the modified files to carry prominent notices
X    stating that you changed the files and the date of any change.
X
X    b) You must cause any work that you distribute or publish, that in
X    whole or in part contains or is derived from the Program or any
X    part thereof, to be licensed as a whole at no charge to all third
X    parties under the terms of this License.
X
X    c) If the modified program normally reads commands interactively
X    when run, you must cause it, when started running for such
X    interactive use in the most ordinary way, to print or display an
X    announcement including an appropriate copyright notice and a
X    notice that there is no warranty (or else, saying that you provide
X    a warranty) and that users may redistribute the program under
X    these conditions, and telling the user how to view a copy of this
X    License.  (Exception: if the Program itself is interactive but
X    does not normally print such an announcement, your work based on
X    the Program is not required to print an announcement.)
X
XThese requirements apply to the modified work as a whole.  If
Xidentifiable sections of that work are not derived from the Program,
Xand can be reasonably considered independent and separate works in
Xthemselves, then this License, and its terms, do not apply to those
Xsections when you distribute them as separate works.  But when you
Xdistribute the same sections as part of a whole which is a work based
Xon the Program, the distribution of the whole must be on the terms of
Xthis License, whose permissions for other licensees extend to the
Xentire whole, and thus to each and every part regardless of who wrote it.
X
XThus, it is not the intent of this section to claim rights or contest
Xyour rights to work written entirely by you; rather, the intent is to
Xexercise the right to control the distribution of derivative or
Xcollective works based on the Program.
X
XIn addition, mere aggregation of another work not based on the Program
Xwith the Program (or with a work based on the Program) on a volume of
Xa storage or distribution medium does not bring the other work under
Xthe scope of this License.
X
X  3. You may copy and distribute the Program (or a work based on it,
Xunder Section 2) in object code or executable form under the terms of
XSections 1 and 2 above provided that you also do one of the following:
X
X    a) Accompany it with the complete corresponding machine-readable
X    source code, which must be distributed under the terms of Sections
X    1 and 2 above on a medium customarily used for software 
interchange; or,
X
X    b) Accompany it with a written offer, valid for at least three
X    years, to give any third party, for a charge no more than your
X    cost of physically performing source distribution, a complete
X    machine-readable copy of the corresponding source code, to be
X    distributed under the terms of Sections 1 and 2 above on a medium
X    customarily used for software interchange; or,
X
X    c) Accompany it with the information you received as to the offer
X    to distribute corresponding source code.  (This alternative is
X    allowed only for noncommercial distribution and only if you
X    received the program in object code or executable form with such
X    an offer, in accord with Subsection b above.)
X
XThe source code for a work means the preferred form of the work for
Xmaking modifications to it.  For an executable work, complete source
Xcode means all the source code for all modules it contains, plus any
Xassociated interface definition files, plus the scripts used to
Xcontrol compilation and installation of the executable.  However, as a
Xspecial exception, the source code distributed need not include
Xanything that is normally distributed (in either source or binary
Xform) with the major components (compiler, kernel, and so on) of the
Xoperating system on which the executable runs, unless that component
Xitself accompanies the executable.
X
XIf distribution of executable or object code is made by offering
Xaccess to copy from a designated place, then offering equivalent
Xaccess to copy the source code from the same place counts as
Xdistribution of the source code, even though third parties are not
Xcompelled to copy the source along with the object code.
X
X  4. You may not copy, modify, sublicense, or distribute the Program
Xexcept as expressly provided under this License.  Any attempt
Xotherwise to copy, modify, sublicense or distribute the Program is
Xvoid, and will automatically terminate your rights under this License.
XHowever, parties who have received copies, or rights, from you under
Xthis License will not have their licenses terminated so long as such
Xparties remain in full compliance.
X
X  5. You are not required to accept this License, since you have not
Xsigned it.  However, nothing else grants you permission to modify or
Xdistribute the Program or its derivative works.  These actions are
Xprohibited by law if you do not accept this License.  Therefore, by
Xmodifying or distributing the Program (or any work based on the
XProgram), you indicate your acceptance of this License to do so, and
Xall its terms and conditions for copying, distributing or modifying
Xthe Program or works based on it.
X
X  6. Each time you redistribute the Program (or any work based on the
XProgram), the recipient automatically receives a license from the
Xoriginal licensor to copy, distribute or modify the Program subject to
Xthese terms and conditions.  You may not impose any further
Xrestrictions on the recipients' exercise of the rights granted herein.
XYou are not responsible for enforcing compliance by third parties to
Xthis License.
X
X  7. If, as a consequence of a court judgment or allegation of patent
Xinfringement or for any other reason (not limited to patent issues),
Xconditions are imposed on you (whether by court order, agreement or
Xotherwise) that contradict the conditions of this License, they do not
Xexcuse you from the conditions of this License.  If you cannot
Xdistribute so as to satisfy simultaneously your obligations under this
XLicense and any other pertinent obligations, then as a consequence you
Xmay not distribute the Program at all.  For example, if a patent
Xlicense would not permit royalty-free redistribution of the Program by
Xall those who receive copies directly or indirectly through you, then
Xthe only way you could satisfy both it and this License would be to
Xrefrain entirely from distribution of the Program.
X
XIf any portion of this section is held invalid or unenforceable under
Xany particular circumstance, the balance of the section is intended to
Xapply and the section as a whole is intended to apply in other
Xcircumstances.
X
XIt is not the purpose of this section to induce you to infringe any
Xpatents or other property right claims or to contest validity of any
Xsuch claims; this section has the sole purpose of protecting the
Xintegrity of the free software distribution system, which is
Ximplemented by public license practices.  Many people have made
Xgenerous contributions to the wide range of software distributed
Xthrough that system in reliance on consistent application of that
Xsystem; it is up to the author/donor to decide if he or she is willing
Xto distribute software through any other system and a licensee cannot
Ximpose that choice.
X
XThis section is intended to make thoroughly clear what is believed to
Xbe a consequence of the rest of this License.
X
X  8. If the distribution and/or use of the Program is restricted in
Xcertain countries either by patents or by copyrighted interfaces, the
Xoriginal copyright holder who places the Program under this License
Xmay add an explicit geographical distribution limitation excluding
Xthose countries, so that distribution is permitted only in or among
Xcountries not thus excluded.  In such case, this License incorporates
Xthe limitation as if written in the body of this License.
X
X  9. The Free Software Foundation may publish revised and/or new versions
Xof the General Public License from time to time.  Such new versions will
Xbe similar in spirit to the present version, but may differ in detail to
Xaddress new problems or concerns.
X
XEach version is given a distinguishing version number.  If the Program
Xspecifies a version number of this License which applies to it and "any
Xlater version", you have the option of following the terms and conditions
Xeither of that version or of any later version published by the Free
XSoftware Foundation.  If the Program does not specify a version number of
Xthis License, you may choose any version ever published by the Free 
Software
XFoundation.
X
X  10. If you wish to incorporate parts of the Program into other free
Xprograms whose distribution conditions are different, write to the author
Xto ask for permission.  For software which is copyrighted by the Free
XSoftware Foundation, write to the Free Software Foundation; we sometimes
Xmake exceptions for this.  Our decision will be guided by the two goals
Xof preserving the free status of all derivatives of our free software and
Xof promoting the sharing and reuse of software generally.
X
X			    NO WARRANTY
X
X  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
XFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
XOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
XPROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
XOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
XMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
XTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
XPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
XREPAIR OR CORRECTION.
X
X  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
XWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
XREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
XINCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
XOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
XTO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
XYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
XPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
XPOSSIBILITY OF SUCH DAMAGES.
X
X		     END OF TERMS AND CONDITIONS
X
X
X	    How to Apply These Terms to Your New Programs
X
X  If you develop a new program, and you want it to be of the greatest
Xpossible use to the public, the best way to achieve this is to make it
Xfree software which everyone can redistribute and change under these terms.
X
X  To do so, attach the following notices to the program.  It is safest
Xto attach them to the start of each source file to most effectively
Xconvey the exclusion of warranty; and each file should have at least
Xthe "copyright" line and a pointer to where the full notice is found.
X
X    <one line to give the program's name and a brief idea of what it does.>
X    Copyright (C) 19yy  <name of author>
X
X    This program is free software; you can redistribute it and/or modify
X    it under the terms of the GNU General Public License as published by
X    the Free Software Foundation; either version 2 of the License, or
X    (at your option) any later version.
X
X    This program is distributed in the hope that it will be useful,
X    but WITHOUT ANY WARRANTY; without even the implied warranty of
X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X    GNU General Public License for more details.
X
X    You should have received a copy of the GNU General Public License
X    along with this program; if not, write to the Free Software
X    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 
02111-1307  USA
X
X
XAlso add information on how to contact you by electronic and paper mail.
X
XIf the program is interactive, make it output a short notice like this
Xwhen it starts in an interactive mode:
X
X    Gnomovision version 69, Copyright (C) 19yy name of author
X    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type 
`show w'.
X    This is free software, and you are welcome to redistribute it
X    under certain conditions; type `show c' for details.
X
XThe hypothetical commands `show w' and `show c' should show the appropriate
Xparts of the General Public License.  Of course, the commands you use may
Xbe called something other than `show w' and `show c'; they could even be
Xmouse-clicks or menu items--whatever suits your program.
X
XYou should also get your employer (if you work as a programmer) or your
Xschool, if any, to sign a "copyright disclaimer" for the program, if
Xnecessary.  Here is a sample; alter the names:
X
X  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
X  `Gnomovision' (which makes passes at compilers) written by James Hacker.
X
X  <signature of Ty Coon>, 1 April 1989
X  Ty Coon, President of Vice
X
XThis General Public License does not permit incorporating your program into
Xproprietary programs.  If your program is a subroutine library, you may
Xconsider it more useful to permit linking proprietary applications with the
Xlibrary.  If this is what you want to do, use the GNU Library General
XPublic License instead of this License.
END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/GPL
echo x - p5-MIME-EncWords/work/MIME-EncWords-0.040/MANIFEST
sed 's/^X//' >p5-MIME-EncWords/work/MIME-EncWords-0.040/MANIFEST << 
'END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/MANIFEST'
XARTISTIC
XChanges
XEncWords.pm
XGPL
XMakefile.PL
XMANIFEST			This list of files
XMETA.yml			Module meta-data (added by MakeMaker)
XREADME
Xt/01decode.t
Xt/02encode.t
Xtestin/decode-singlebyte.txt
Xtestin/encode-singlebyte.txt
END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/MANIFEST
echo x - p5-MIME-EncWords/work/MIME-EncWords-0.040/META.yml
sed 's/^X//' >p5-MIME-EncWords/work/MIME-EncWords-0.040/META.yml << 
'END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/META.yml'
X# http://module-build.sourceforge.net/META-spec.html
X#XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
Xname:         MIME-EncWords
Xversion:      0.040
Xversion_from: EncWords.pm
Xinstalldirs:  site
Xrequires:
X    Encode:                        1.98
X    MIME::Base64:                  2.13
X    MIME::Charset:                 0.04.1
X    Test:                          0
X
Xdistribution_type: module
Xgenerated_by: ExtUtils::MakeMaker version 6.17
END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/META.yml
echo x - p5-MIME-EncWords/work/MIME-EncWords-0.040/Makefile.PL
sed 's/^X//' >p5-MIME-EncWords/work/MIME-EncWords-0.040/Makefile.PL << 
'END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/Makefile.PL'
Xuse ExtUtils::MakeMaker;
X
XWriteMakefile(
X	'NAME'		=> 'MIME::EncWords',
X	'ABSTRACT_FROM'	=> 'EncWords.pm',
X	'VERSION_FROM'	=> 'EncWords.pm',
X	'PREREQ_PM'	=> ($] >= 5.008001)? {
X	    'Encode'		=> 1.98,
X	    'MIME::Charset'	=> '0.04.1',
X	    'MIME::Base64'	=> 2.13,
X	    'Test'		=> 0,
X	}: {
X	    'MIME::Charset'	=> '0.04.1',
X	    'MIME::Base64'	=> 2.13,
X	    'Test'		=> 0,
X	},
X);
X
END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/Makefile.PL
echo x - p5-MIME-EncWords/work/MIME-EncWords-0.040/README
sed 's/^X//' >p5-MIME-EncWords/work/MIME-EncWords-0.040/README << 
'END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/README'
XNAME
X    MIME::EncWords - deal with RFC-1522 encoded words (improved)
X
XSYNOPSIS
X    *MIME::EncWords is aimed to be another implimentation of MIME::Words so
X    that it will achive more exact conformance with MIME specifications.
X    Additionally, it contains some improvements. Following synopsis and
X    descriptions are inherited from its inspirer, with description of
X    improvements and clarifications added.*
X
X    Before reading further, you should see MIME::Tools to make sure 
that you
X    understand where this module fits into the grand scheme of things. Go
X    on, do it now. I'll wait.
X
X    Ready? Ok...
X
X        use MIME::EncWords qw(:all);
X
X        ### Decode the string into another string, forgetting the charsets:
X        $decoded = decode_mimewords(
X              'To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld at dkuug.dk>',
X              );
X
X        ### Split string into array of decoded [DATA,CHARSET] pairs:
X        @decoded = decode_mimewords(
X              'To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld at dkuug.dk>',
X              );
X
X        ### Encode a single unsafe word:
X        $encoded = encode_mimeword("\xABFran\xE7ois\xBB");
X
X        ### Encode a string, trying to find the unsafe words inside it:
X        $encoded = encode_mimewords("Me and \xABFran\xE7ois\xBB in town");
X
XDESCRIPTION
X    Fellow Americans, you probably won't know what the hell this module is
X    for. Europeans, Russians, et al, you probably do. ":-)".
X
X    For example, here's a valid MIME header you might get:
X
X          From: =?US-ASCII?Q?Keith_Moore?= <moore at cs.utk.edu>
X          To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld at dkuug.dk>
X          CC: =?ISO-8859-1?Q?Andr=E9_?= Pirard <PIRARD at vm1.ulg.ac.be>
X          Subject: =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=
X           =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=
X           =?US-ASCII?Q?.._cool!?=
X
X    The fields basically decode to (sorry, I can only approximate the Latin
X    characters with 7 bit sequences /o and 'e):
X
X          From: Keith Moore <moore at cs.utk.edu>
X          To: Keld J/orn Simonsen <keld at dkuug.dk>
X          CC: Andr'e  Pirard <PIRARD at vm1.ulg.ac.be>
X          Subject: If you can read this you understand the example... cool!
X
X    Supplement: Fellow Americans, Europeans, you probably won't know what
X    the hell this module is for. East Asians, et al, you probably do. 
":-)".
X
X    For example, here's a valid MIME header you might get:
X
X          Subject: =?EUC-KR?B?sNTAuLinKGxhemluZXNzKSwgwvzB9ri7seIoaW1w?=
X           =?EUC-KR?B?YXRpZW5jZSksILGzuLgoaHVicmlzKQ==?=
X
X    The fields basically decode to (sorry, I cannot approximate the
X    non-Latin multibyte characters with any 7 bit sequences):
X
X          Subject: ???(laziness), ????(impatience), ??(hubris)
X
XPUBLIC INTERFACE
X    decode_mimewords ENCODED, [OPTS...]
X        *Function.* Go through the string looking for RFC-1522-style "Q"
X        (quoted-printable, sort of) or "B" (base64) encoding, and decode
X        them.
X
X        In an array context, splits the ENCODED string into a list of
X        decoded "[DATA, CHARSET]" pairs, and returns that list. Unencoded
X        data are returned in a 1-element array "[DATA]", giving an 
effective
X        CHARSET of "undef".
X
X            $enc = '=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld at dkuug.dk>';
X            foreach (decode_mimewords($enc)) {
X                print "", ($_[1] || 'US-ASCII'), ": ", $_[0], "\n";
X            }
X
X        In a scalar context, joins the "data" elements of the above list
X        together, and returns that. *Warning: this is information-lossy,*
X        and probably *not* what you want, but if you know that all charsets
X        in the ENCODED string are identical, it might be useful to you.
X        (Before you use this, please see "unmime" in MIME::WordDecoder,
X        which is probably what you want.) Note: See also "Charset" option
X        below.
X
X        In the event of a syntax error, $@ will be set to a description of
X        the error, but parsing will continue as best as possible (so as to
X        get *something* back when decoding headers). $@ will be false if no
X        error was detected.
X
X        Any arguments past the ENCODED string are taken to define a hash of
X        options:
X
X        Charset
X            Improvement by this module: Name of character set by which data
X            elements in scalar context will be converted. If this option is
X            specified as special value "_UNICODE_", returned value will be
X            Unicode string.
X
X            When Unicode/multibyte support is disabled (see "USE_ENCODE" in
X            MIME::Charset), this option will not have any effects.
X
X            Note: This feature is still information-lossy, *except* when
X            "_UNICODE_" is specified.
X
X        Field
X            Name of the mail field this string came from. *Currently
X            ignored.*
X
X        Improvement by this module: Adjacent encoded-words with same 
charset
X        will be concatenated to handle multibyte sequences safely.
X
X        Change by this module: Malformed base64 encoded-words will be kept
X        encoded. In this case $@ will be set.
X
X        Compatibility with MIME::Words: Whitespaces surrounding unencoded
X        data will not be stripped.
X
X    encode_mimeword RAW, [ENCODING], [CHARSET]
X        *Function.* Encode a single RAW "word" that has unsafe characters.
X        The "word" will be encoded in its entirety.
X
X            ### Encode "<<Franc,ois>>":
X            $encoded = encode_mimeword("\xABFran\xE7ois\xBB");
X
X        You may specify the ENCODING ("Q" or "B"), which defaults to "Q".
X        Improvement by this module: You may also specify it as ``special''
X        value: "S" to choose shorter one of either "Q" or "B".
X
X        You may specify the CHARSET, which defaults to "iso-8859-1".
X
X        Change by this module: Spaces will be escaped with ``_'' by "Q"
X        encoding.
X
X    encode_mimewords RAW, [OPTS]
X        *Function.* Given a RAW string, try to find and encode all "unsafe"
X        sequences of characters:
X
X            ### Encode a string with some unsafe "words":
X            $encoded = encode_mimewords("Me and \xABFran\xE7ois\xBB");
X
X        Returns the encoded string.
X
X        Improvement by this module: RAW may be a Unicode string when
X        Unicode/multibyte support is enabled (see "USE_ENCODE" in
X        MIME::Charset). Furthermore, RAW may be a reference to that 
returned
X        by "decode_mimewords" on array context. In latter case "Charset"
X        option (see below) will be overridden (see also notes below).
X
X        Any arguments past the RAW string are taken to define a hash of
X        options:
X
X        Charset
X            Encode all unsafe stuff with this charset. Default is
X            'ISO-8859-1', a.k.a. "Latin-1".
X
X        Detect7bit
X            Improvement by this modlue: When "Encoding" option (see below)
X            is specified as "a" and "Charset" option is unknown, try to
X            detect 7-bit charset on given RAW string. Default is "YES". 
When
X            Unicode/multibyte support is disabled, this option will not 
have
X            any effects (see "USE_ENCODE" in MIME::Charset).
X
X        Encoding
X            The encoding to use, "q" or "b". The default is "q". 
Improvement
X            by this module: You may also specify ``special'' values: "a"
X            will automatically choose recommended encoding to use (with
X            charset conversion if alternative charset is recommended: see
X            MIME::Charset); "s" will choose shorter one of either "q" or
X            "b".
X
X        Field
X            Name of the mail field this string will be used in. Improvement
X            by this module: Length of mail field name will be considered in
X            the first line of encoded header.
X
X        Notes on improvement by this module: When RAW is an arrayref,
X        adjacent encoded-words are concatenated. Then they are splitted
X        taking care of character boundaries of multibyte sequences, when
X        Unicode/multibyte support is enabled. Portions for unencoded data
X        should include surrounding whitespace(s), or they will be merged
X        into adjoining encoded word(s).
X
X        Imcompatibility with MIME::Words: MIME::Words takes care of natural
X        word separators (i.e. whitespaces) in the text to be encoded. This
X        module will encode whole text (if encoding needed) not mentioning
X        whitespaces; encoded-words exceeding line length will be splitted
X        based only on their lengths.
X
XVERSION
X    Consult $VERSION variable.
X
X    Development versions of this module may be found at
X    <http://hatuka.nezumi.nu/repos/MIME-EncWords/>.
X
XSEE ALSO
X    MIME::Charset, MIME::Tools
X
XAUTHORS
X    The original version of function decode_mimewords() is derived from
X    MIME::Words module that was written by: Eryq (eryq at zeegee.com), ZeeGee
X    Software Inc (http://www.zeegee.com). David F. Skoll
X    (dfs at roaringpenguin.com) http://www.roaringpenguin.com
X
X    Other stuff are rewritten or added by: Hatuka*nezumi - IKEDA Soji
X    <hatuka(at)nezumi.nu>.
X
X    All rights reserved. This program is free software; you can 
redistribute
X    it and/or modify it under the same terms as Perl itself.
X
END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/README
echo c - p5-MIME-EncWords/work/MIME-EncWords-0.040/t
mkdir -p p5-MIME-EncWords/work/MIME-EncWords-0.040/t > /dev/null 2>&1
echo x - p5-MIME-EncWords/work/MIME-EncWords-0.040/t/01decode.t
sed 's/^X//' >p5-MIME-EncWords/work/MIME-EncWords-0.040/t/01decode.t << 
'END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/t/01decode.t'
Xuse strict;
Xuse Test;
X
XBEGIN { plan tests => ($] >= 5.008001)? 20: 10 }
X
Xmy $_UNICODE = ($] >= 5.008001);
Xif ($_UNICODE) {
X    use Encode;
X}
X
Xuse MIME::EncWords qw(decode_mimewords);
X
X{
X    local($/) = '';
X    open WORDS, "<testin/decode-singlebyte.txt" or die "open: $!";
X    while (<WORDS>) {
X	s{\A\s+|\s+\Z}{}g;    # trim
X
X	my ($isgood, $expect, $enc) = split /\n/, $_, 3;
X	$isgood = (uc($isgood) eq 'GOOD');
X	$expect = eval $expect;
X
X	my $dec = decode_mimewords($enc);
X	ok((($isgood && !$@) or (!$isgood && $@)) and
X           ($isgood ? ($dec eq $expect) : 1));
X	if ($_UNICODE) {
X	    $dec = decode_mimewords($enc, Charset => "utf-8");
X	    Encode::from_to($expect, "iso-8859-1", "utf-8");
X	    ok((($isgood && !$@) or (!$isgood && $@)) and
X		($isgood ? ($dec eq $expect) : 1));
X	}
X    }
X    close WORDS;
X}
X
X1;
X
END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/t/01decode.t
echo x - p5-MIME-EncWords/work/MIME-EncWords-0.040/t/02encode.t
sed 's/^X//' >p5-MIME-EncWords/work/MIME-EncWords-0.040/t/02encode.t << 
'END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/t/02encode.t'
Xuse strict;
Xuse Test;
X
XBEGIN { plan tests => 9 }
X
Xuse MIME::Charset qw(header_encode);
Xuse MIME::EncWords qw(encode_mimewords);
X
X{
X    local($/) = '';
X    open WORDS, "<testin/encode-singlebyte.txt" or die "open: $!";
X    while (<WORDS>) {
X	s{\A\s+|\s+\Z}{}g;    # trim
X
X	my ($isgood, $dec, $expect) = split /\n/, $_, 3;
X	$isgood = (uc($isgood) eq 'GOOD');
X	$dec = eval $dec;
X
X	my $enc = encode_mimewords($dec, Charset=>"ISO-8859-1", Encoding=>"A");
X	ok((($isgood && !$@) or (!$isgood && $@)) and
X           ($isgood ? ($enc eq $expect) : 1));
X    }
X    close WORDS;
X}
X
X1;
X
END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/t/02encode.t
echo c - p5-MIME-EncWords/work/MIME-EncWords-0.040/testin
mkdir -p p5-MIME-EncWords/work/MIME-EncWords-0.040/testin > /dev/null 2>&1
echo x - 
p5-MIME-EncWords/work/MIME-EncWords-0.040/testin/decode-singlebyte.txt
sed 's/^X//' 
 >p5-MIME-EncWords/work/MIME-EncWords-0.040/testin/decode-singlebyte.txt 
<< 
'END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/testin/decode-singlebyte.txt'
XGOOD
X"Subject: Oc\xE9 3165 Network Copier down for maintenance"
XSubject: =?ISO-8859-1?Q?Oc=E9_3165_Network_Copier_down_for_maintenance?=
X
XBAD
X""
XSubject: =?ISO-8859-1?Q?Oc=E9_3165_Network_Copier_down_for_maintenance?
X
XBAD
X""
XSubject: =?ISO-8859-1?Q?Oc=E9_3165_Network_Copier_down_for_maintenance
X
XGOOD
X"Keith Moore <moore\@cs.utk.edu>"
X=?US-ASCII?Q?Keith_Moore?= <moore at cs.utk.edu>
X
XGOOD
X"Keld J\xF8rn Simonsen <keld\@dkuug.dk>"
X=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld at dkuug.dk>
X
XGOOD
X"Andr\xE9 (<- one space) Pirard <PIRARD\@vm1.ulg.ac.be>"
X=?ISO-8859-1?Q?Andr=E9_?=(<- one space) Pirard <PIRARD at vm1.ulg.ac.be>
X
XGOOD
X"Andr\xE9  (<- two spaces) Pirard <PIRARD\@vm1.ulg.ac.be>"
X=?ISO-8859-1?Q?Andr=E9_?= (<- two spaces) Pirard <PIRARD at vm1.ulg.ac.be>
X
XGOOD
X"If you can read this you understand the example... cool!"
X=?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?==?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?==?US-ASCII?Q?.._cool!?=
X
XGOOD
X"If you can read this you understand the example... cool!"
X=?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=
X	=?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=
X	=?US-ASCII?Q?.._cool!?=
X
XGOOD
X"_-_"
X=?ISO-8859-1?Q?=5F-=5F?=
X
X
X
END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/testin/decode-singlebyte.txt
echo x - 
p5-MIME-EncWords/work/MIME-EncWords-0.040/testin/encode-singlebyte.txt
sed 's/^X//' 
 >p5-MIME-EncWords/work/MIME-EncWords-0.040/testin/encode-singlebyte.txt 
<< 
'END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/testin/encode-singlebyte.txt'
XGOOD
X"Oc\xE9 3165 Network Copier down for maintenance"
X=?ISO-8859-1?Q?Oc=E9?= 3165 Network Copier down for maintenance
X
XGOOD
X"Keith Moore <moore\@cs.utk.edu>"
XKeith Moore <moore at cs.utk.edu>
X
XGOOD
X[["Keld J\xF8rn Simonsen"],[" "],["<keld\@dkuug.dk>"]]
X=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld at dkuug.dk>
X
XGOOD
X[["Andr\xE9 "],["(<- one space) Pirard"],[" "],["<PIRARD\@vm1.ulg.ac.be>"]]
X=?ISO-8859-1?Q?Andr=E9_(<-?= one space) Pirard <PIRARD at vm1.ulg.ac.be>
X
XGOOD
X[["Andr\xE9"],[" (<- one space) Pirard"],[" "],["<PIRARD\@vm1.ulg.ac.be>"]]
X=?ISO-8859-1?Q?Andr=E9?= (<- one space) Pirard <PIRARD at vm1.ulg.ac.be>
X
XGOOD
X[["Andr\xE9  "],["(<- two spaces) Pirard"],[" 
"],["<PIRARD\@vm1.ulg.ac.be>"]]
X=?ISO-8859-1?Q?Andr=E9__(<-?= two spaces) Pirard <PIRARD at vm1.ulg.ac.be>
X
XGOOD
X[["Andr\xE9 "],[" (<- two spaces) Pirard"],[" 
"],["<PIRARD\@vm1.ulg.ac.be>"]]
X=?ISO-8859-1?Q?Andr=E9_?= (<- two spaces) Pirard <PIRARD at vm1.ulg.ac.be>
X
XGOOD
X[["Andr\xE9"],["  (<- two spaces) Pirard"],[" 
"],["<PIRARD\@vm1.ulg.ac.be>"]]
X=?ISO-8859-1?Q?Andr=E9?= (<- two spaces) Pirard <PIRARD at vm1.ulg.ac.be>
X
XGOOD
X"_-_"
X_-_
X
END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/testin/encode-singlebyte.txt
echo x - p5-MIME-EncWords/work/MIME-EncWords-0.040/Makefile
sed 's/^X//' >p5-MIME-EncWords/work/MIME-EncWords-0.040/Makefile << 
'END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/Makefile'
X# This Makefile is for the MIME::EncWords extension to perl.
X#
X# It was generated automatically by MakeMaker version
X# 6.30 (Revision: Revision: 4535 ) from the contents of
X# Makefile.PL. Don't edit this file, edit Makefile.PL instead.
X#
X#       ANY CHANGES MADE HERE WILL BE LOST!
X#
X#   MakeMaker ARGV: (q[INSTALLDIRS=site], q[CC=cc], q[CCFLAGS=-O2 
-fno-strict-aliasing -pipe ], q[PREFIX=/var/tmp/MIME-EncWords], 
q[INSTALLPRIVLIB=/var/tmp/MIME-EncWords/lib], 
q[INSTALLARCHLIB=/var/tmp/MIME-EncWords/lib])
X#
X#   MakeMaker Parameters:
X
X#     ABSTRACT_FROM => q[EncWords.pm]
X#     NAME => q[MIME::EncWords]
X#     PREREQ_PM => { MIME::Base64=>q[2.13], Test=>q[0], 
MIME::Charset=>q[0.04.1], Encode=>q[1.98] }
X#     VERSION_FROM => q[EncWords.pm]
X
X# --- MakeMaker post_initialize section:
X
X
X# --- MakeMaker const_config section:
X
X# These definitions are from config.sh (via 
/usr/local/lib/perl5/5.8.8/mach/Config.pm)
X
X# They may have been overridden via Makefile.PL or on the command line
XAR = ar
XCC = cc
XCCCDLFLAGS = -DPIC -fPIC
XCCDLFLAGS =   -Wl,-R/usr/local/lib/perl5/5.8.8/mach/CORE
XDLEXT = so
XDLSRC = dl_dlopen.xs
XLD = cc
XLDDLFLAGS = -shared
XLDFLAGS =  -Wl,-E
XLIBC =
XLIB_EXT = .a
XOBJ_EXT = .o
XOSNAME = freebsd
XOSVERS = 6.2-release-p4
XRANLIB = :
XSITELIBEXP = /usr/local/lib/perl5/site_perl/5.8.8
XSITEARCHEXP = /usr/local/lib/perl5/site_perl/5.8.8/mach
XSO = so
XEXE_EXT =
XFULL_AR = /usr/bin/ar
XVENDORARCHEXP =
XVENDORLIBEXP =
X
X
X# --- MakeMaker constants section:
XAR_STATIC_ARGS = cr
XDIRFILESEP = /
XDFSEP = $(DIRFILESEP)
XNAME = MIME::EncWords
XNAME_SYM = MIME_EncWords
XVERSION = 0.040
XVERSION_MACRO = VERSION
XVERSION_SYM = 0_040
XDEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\"
XXS_VERSION = 0.040
XXS_VERSION_MACRO = XS_VERSION
XXS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\"
XINST_ARCHLIB = blib/arch
XINST_SCRIPT = blib/script
XINST_BIN = blib/bin
XINST_LIB = blib/lib
XINST_MAN1DIR = blib/man1
XINST_MAN3DIR = blib/man3
XMAN1EXT = 1
XMAN3EXT = 3
XINSTALLDIRS = site
XDESTDIR =
XPREFIX = /var/tmp/MIME-EncWords
XPERLPREFIX = $(PREFIX)
XSITEPREFIX = $(PREFIX)
XVENDORPREFIX = $(PREFIX)
XINSTALLPRIVLIB = /var/tmp/MIME-EncWords/lib
XDESTINSTALLPRIVLIB = $(DESTDIR)$(INSTALLPRIVLIB)
XINSTALLSITELIB = $(SITEPREFIX)/lib/perl5/site_perl/5.8.8
XDESTINSTALLSITELIB = $(DESTDIR)$(INSTALLSITELIB)
XINSTALLVENDORLIB =
XDESTINSTALLVENDORLIB = $(DESTDIR)$(INSTALLVENDORLIB)
XINSTALLARCHLIB = /var/tmp/MIME-EncWords/lib
XDESTINSTALLARCHLIB = $(DESTDIR)$(INSTALLARCHLIB)
XINSTALLSITEARCH = $(SITEPREFIX)/lib/perl5/site_perl/5.8.8/mach
XDESTINSTALLSITEARCH = $(DESTDIR)$(INSTALLSITEARCH)
XINSTALLVENDORARCH =
XDESTINSTALLVENDORARCH = $(DESTDIR)$(INSTALLVENDORARCH)
XINSTALLBIN = $(PERLPREFIX)/bin
XDESTINSTALLBIN = $(DESTDIR)$(INSTALLBIN)
XINSTALLSITEBIN = $(SITEPREFIX)/bin
XDESTINSTALLSITEBIN = $(DESTDIR)$(INSTALLSITEBIN)
XINSTALLVENDORBIN =
XDESTINSTALLVENDORBIN = $(DESTDIR)$(INSTALLVENDORBIN)
XINSTALLSCRIPT = $(PERLPREFIX)/bin
XDESTINSTALLSCRIPT = $(DESTDIR)$(INSTALLSCRIPT)
XINSTALLMAN1DIR = $(PERLPREFIX)/man/man1
XDESTINSTALLMAN1DIR = $(DESTDIR)$(INSTALLMAN1DIR)
XINSTALLSITEMAN1DIR = $(SITEPREFIX)/man/man1
XDESTINSTALLSITEMAN1DIR = $(DESTDIR)$(INSTALLSITEMAN1DIR)
XINSTALLVENDORMAN1DIR =
XDESTINSTALLVENDORMAN1DIR = $(DESTDIR)$(INSTALLVENDORMAN1DIR)
XINSTALLMAN3DIR = $(PERLPREFIX)/lib/perl5/5.8.8/perl/man/man3
XDESTINSTALLMAN3DIR = $(DESTDIR)$(INSTALLMAN3DIR)
XINSTALLSITEMAN3DIR = $(SITEPREFIX)/lib/perl5/5.8.8/man/man3
XDESTINSTALLSITEMAN3DIR = $(DESTDIR)$(INSTALLSITEMAN3DIR)
XINSTALLVENDORMAN3DIR =
XDESTINSTALLVENDORMAN3DIR = $(DESTDIR)$(INSTALLVENDORMAN3DIR)
XPERL_LIB = /usr/local/lib/perl5/5.8.8
XPERL_ARCHLIB = /usr/local/lib/perl5/5.8.8/mach
XLIBPERL_A = libperl.a
XFIRST_MAKEFILE = Makefile
XMAKEFILE_OLD = Makefile.old
XMAKE_APERL_FILE = Makefile.aperl
XPERLMAINCC = $(CC)
XPERL_INC = /usr/local/lib/perl5/5.8.8/mach/CORE
XPERL = /usr/local/bin/perl5.8.8
XFULLPERL = /usr/local/bin/perl5.8.8
XABSPERL = $(PERL)
XPERLRUN = $(PERL)
XFULLPERLRUN = $(FULLPERL)
XABSPERLRUN = $(ABSPERL)
XPERLRUNINST = $(PERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"
XFULLPERLRUNINST = $(FULLPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"
XABSPERLRUNINST = $(ABSPERLRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"
XPERL_CORE = 0
XPERM_RW = 644
XPERM_RWX = 755
X
XMAKEMAKER   = /usr/local/lib/perl5/5.8.8/ExtUtils/MakeMaker.pm
XMM_VERSION  = 6.30
XMM_REVISION = Revision: 4535
X
X# FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle).
X# BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg 
Oracle)
X# PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar)
X# DLBASE  = Basename part of dynamic library. May be just equal BASEEXT.
XFULLEXT = MIME/EncWords
XBASEEXT = EncWords
XPARENT_NAME = MIME
XDLBASE = $(BASEEXT)
XVERSION_FROM = EncWords.pm
XOBJECT =
XLDFROM = $(OBJECT)
XLINKTYPE = dynamic
XBOOTDEP =
X
X# Handy lists of source code files:
XXS_FILES =
XC_FILES  =
XO_FILES  =
XH_FILES  =
XMAN1PODS =
XMAN3PODS = EncWords.pm
X
X# Where is the Config information that we are using/depend on
XCONFIGDEP = $(PERL_ARCHLIB)$(DFSEP)Config.pm $(PERL_INC)$(DFSEP)config.h
X
X# Where to build things
XINST_LIBDIR      = $(INST_LIB)/MIME
XINST_ARCHLIBDIR  = $(INST_ARCHLIB)/MIME
X
XINST_AUTODIR     = $(INST_LIB)/auto/$(FULLEXT)
XINST_ARCHAUTODIR = $(INST_ARCHLIB)/auto/$(FULLEXT)
X
XINST_STATIC      =
XINST_DYNAMIC     =
XINST_BOOT        =
X
X# Extra linker info
XEXPORT_LIST        =
XPERL_ARCHIVE       =
XPERL_ARCHIVE_AFTER =
X
X
XTO_INST_PM = EncWords.pm
X
XPM_TO_BLIB = EncWords.pm \
X	$(INST_LIB)/MIME/EncWords.pm
X
X
X# --- MakeMaker platform_constants section:
XMM_Unix_VERSION = 1.50
XPERL_MALLOC_DEF = -DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc 
-Dfree=Perl_mfree -Drealloc=Perl_realloc -Dcalloc=Perl_calloc
X
X
X# --- MakeMaker tool_autosplit section:
X# Usage: $(AUTOSPLITFILE) FileToSplit AutoDirToSplitInto
XAUTOSPLITFILE = $(ABSPERLRUN)  -e 'use AutoSplit;  autosplit($$ARGV[0], 
$$ARGV[1], 0, 1, 1)'
X
X
X
X# --- MakeMaker tool_xsubpp section:
X
X
X# --- MakeMaker tools_other section:
XSHELL = /bin/sh
XCHMOD = chmod
XCP = cp
XMV = mv
XNOOP = $(SHELL) -c true
XNOECHO = @
XRM_F = rm -f
XRM_RF = rm -rf
XTEST_F = test -f
XTOUCH = touch
XUMASK_NULL = umask 0
XDEV_NULL = > /dev/null 2>&1
XMKPATH = $(ABSPERLRUN) "-MExtUtils::Command" -e mkpath
XEQUALIZE_TIMESTAMP = $(ABSPERLRUN) "-MExtUtils::Command" -e eqtime
XECHO = echo
XECHO_N = echo -n
XUNINST = 0
XVERBINST = 0
XMOD_INSTALL = $(ABSPERLRUN) -MExtUtils::Install -e 'install({@ARGV}, 
'\''$(VERBINST)'\'', 0, '\''$(UNINST)'\'');'
XDOC_INSTALL = $(ABSPERLRUN) "-MExtUtils::Command::MM" -e perllocal_install
XUNINSTALL = $(ABSPERLRUN) "-MExtUtils::Command::MM" -e uninstall
XWARN_IF_OLD_PACKLIST = $(ABSPERLRUN) "-MExtUtils::Command::MM" -e 
warn_if_old_packlist
XMACROSTART =
XMACROEND =
XUSEMAKEFILE = -f
XFIXIN = $(PERLRUN) "-MExtUtils::MY" -e "MY->fixin(shift)"
X
X
X# --- MakeMaker makemakerdflt section:
Xmakemakerdflt: all
X	$(NOECHO) $(NOOP)
X
X
X# --- MakeMaker dist section:
XTAR = tar
XTARFLAGS = cvf
XZIP = zip
XZIPFLAGS = -r
XCOMPRESS = gzip --best
XSUFFIX = .gz
XSHAR = shar
XPREOP = $(NOECHO) $(NOOP)
XPOSTOP = $(NOECHO) $(NOOP)
XTO_UNIX = $(NOECHO) $(NOOP)
XCI = ci -u
XRCS_LABEL = rcs -Nv$(VERSION_SYM): -q
XDIST_CP = best
XDIST_DEFAULT = tardist
XDISTNAME = MIME-EncWords
XDISTVNAME = MIME-EncWords-0.040
X
X
X# --- MakeMaker macro section:
X
X
X# --- MakeMaker depend section:
X
X
X# --- MakeMaker cflags section:
X
X
X# --- MakeMaker const_loadlibs section:
X
X
X# --- MakeMaker const_cccmd section:
X
X
X# --- MakeMaker post_constants section:
X
X
X# --- MakeMaker pasthru section:
X
XPASTHRU = LIBPERL_A="$(LIBPERL_A)"\
X	LINKTYPE="$(LINKTYPE)"\
X	PREFIX="$(PREFIX)"
X
X
X# --- MakeMaker special_targets section:
X.SUFFIXES : .xs .c .C .cpp .i .s .cxx .cc $(OBJ_EXT)
X
X.PHONY: all config static dynamic test linkext manifest blibdirs clean 
realclean disttest distdir
X
X
X
X# --- MakeMaker c_o section:
X
X
X# --- MakeMaker xs_c section:
X
X
X# --- MakeMaker xs_o section:
X
X
X# --- MakeMaker top_targets section:
Xall :: pure_all manifypods
X	$(NOECHO) $(NOOP)
X
X
Xpure_all :: config pm_to_blib subdirs linkext
X	$(NOECHO) $(NOOP)
X
Xsubdirs :: $(MYEXTLIB)
X	$(NOECHO) $(NOOP)
X
Xconfig :: $(FIRST_MAKEFILE) blibdirs
X	$(NOECHO) $(NOOP)
X
Xhelp :
X	perldoc ExtUtils::MakeMaker
X
X
X# --- MakeMaker blibdirs section:
Xblibdirs : $(INST_LIBDIR)$(DFSEP).exists $(INST_ARCHLIB)$(DFSEP).exists 
$(INST_AUTODIR)$(DFSEP).exists $(INST_ARCHAUTODIR)$(DFSEP).exists 
$(INST_BIN)$(DFSEP).exists $(INST_SCRIPT)$(DFSEP).exists 
$(INST_MAN1DIR)$(DFSEP).exists $(INST_MAN3DIR)$(DFSEP).exists
X	$(NOECHO) $(NOOP)
X
X# Backwards compat with 6.18 through 6.25
Xblibdirs.ts : blibdirs
X	$(NOECHO) $(NOOP)
X
X$(INST_LIBDIR)$(DFSEP).exists :: Makefile.PL
X	$(NOECHO) $(MKPATH) $(INST_LIBDIR)
X	$(NOECHO) $(CHMOD) 755 $(INST_LIBDIR)
X	$(NOECHO) $(TOUCH) $(INST_LIBDIR)$(DFSEP).exists
X
X$(INST_ARCHLIB)$(DFSEP).exists :: Makefile.PL
X	$(NOECHO) $(MKPATH) $(INST_ARCHLIB)
X	$(NOECHO) $(CHMOD) 755 $(INST_ARCHLIB)
X	$(NOECHO) $(TOUCH) $(INST_ARCHLIB)$(DFSEP).exists
X
X$(INST_AUTODIR)$(DFSEP).exists :: Makefile.PL
X	$(NOECHO) $(MKPATH) $(INST_AUTODIR)
X	$(NOECHO) $(CHMOD) 755 $(INST_AUTODIR)
X	$(NOECHO) $(TOUCH) $(INST_AUTODIR)$(DFSEP).exists
X
X$(INST_ARCHAUTODIR)$(DFSEP).exists :: Makefile.PL
X	$(NOECHO) $(MKPATH) $(INST_ARCHAUTODIR)
X	$(NOECHO) $(CHMOD) 755 $(INST_ARCHAUTODIR)
X	$(NOECHO) $(TOUCH) $(INST_ARCHAUTODIR)$(DFSEP).exists
X
X$(INST_BIN)$(DFSEP).exists :: Makefile.PL
X	$(NOECHO) $(MKPATH) $(INST_BIN)
X	$(NOECHO) $(CHMOD) 755 $(INST_BIN)
X	$(NOECHO) $(TOUCH) $(INST_BIN)$(DFSEP).exists
X
X$(INST_SCRIPT)$(DFSEP).exists :: Makefile.PL
X	$(NOECHO) $(MKPATH) $(INST_SCRIPT)
X	$(NOECHO) $(CHMOD) 755 $(INST_SCRIPT)
X	$(NOECHO) $(TOUCH) $(INST_SCRIPT)$(DFSEP).exists
X
X$(INST_MAN1DIR)$(DFSEP).exists :: Makefile.PL
X	$(NOECHO) $(MKPATH) $(INST_MAN1DIR)
X	$(NOECHO) $(CHMOD) 755 $(INST_MAN1DIR)
X	$(NOECHO) $(TOUCH) $(INST_MAN1DIR)$(DFSEP).exists
X
X$(INST_MAN3DIR)$(DFSEP).exists :: Makefile.PL
X	$(NOECHO) $(MKPATH) $(INST_MAN3DIR)
X	$(NOECHO) $(CHMOD) 755 $(INST_MAN3DIR)
X	$(NOECHO) $(TOUCH) $(INST_MAN3DIR)$(DFSEP).exists
X
X
X
X# --- MakeMaker linkext section:
X
Xlinkext :: $(LINKTYPE)
X	$(NOECHO) $(NOOP)
X
X
X# --- MakeMaker dlsyms section:
X
X
X# --- MakeMaker dynamic section:
X
Xdynamic :: $(FIRST_MAKEFILE) $(INST_DYNAMIC) $(INST_BOOT)
X	$(NOECHO) $(NOOP)
X
X
X# --- MakeMaker dynamic_bs section:
X
XBOOTSTRAP =
X
X
X# --- MakeMaker dynamic_lib section:
X
X
X# --- MakeMaker static section:
X
X## $(INST_PM) has been moved to the all: target.
X## It remains here for awhile to allow for old usage: "make static"
Xstatic :: $(FIRST_MAKEFILE) $(INST_STATIC)
X	$(NOECHO) $(NOOP)
X
X
X# --- MakeMaker static_lib section:
X
X
X# --- MakeMaker manifypods section:
X
XPOD2MAN_EXE = $(PERLRUN) "-MExtUtils::Command::MM" -e pod2man "--"
XPOD2MAN = $(POD2MAN_EXE)
X
X
Xmanifypods : pure_all  \
X	EncWords.pm \
X	EncWords.pm
X	$(NOECHO) $(POD2MAN) --section=3 --perm_rw=$(PERM_RW) \
X	  EncWords.pm $(INST_MAN3DIR)/MIME::EncWords.$(MAN3EXT)
X
X
X
X
X# --- MakeMaker processPL section:
X
X
X# --- MakeMaker installbin section:
X
X
X# --- MakeMaker subdirs section:
X
X# none
X
X# --- MakeMaker clean_subdirs section:
Xclean_subdirs :
X	$(NOECHO) $(NOOP)
X
X
X# --- MakeMaker clean section:
X
X# Delete temporary files but do not touch installed files. We don't delete
X# the Makefile here so a later make realclean still has a makefile to use.
X
Xclean :: clean_subdirs
X	- $(RM_F) \
X	  *$(LIB_EXT) core \
X	  core.[0-9] $(INST_ARCHAUTODIR)/extralibs.all \
X	  core.[0-9][0-9] $(BASEEXT).bso \
X	  pm_to_blib.ts core.[0-9][0-9][0-9][0-9] \
X	  $(BASEEXT).x $(BOOTSTRAP) \
X	  perl$(EXE_EXT) tmon.out \
X	  *$(OBJ_EXT) pm_to_blib \
X	  $(INST_ARCHAUTODIR)/extralibs.ld blibdirs.ts \
X	  core.[0-9][0-9][0-9][0-9][0-9] *perl.core \
X	  core.*perl.*.? $(MAKE_APERL_FILE) \
X	  perl $(BASEEXT).def \
X	  core.[0-9][0-9][0-9] mon.out \
X	  lib$(BASEEXT).def perlmain.c \
X	  perl.exe so_locations \
X	  $(BASEEXT).exp
X	- $(RM_RF) \
X	  blib
X	- $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD) $(DEV_NULL)
X
X
X# --- MakeMaker realclean_subdirs section:
Xrealclean_subdirs :
X	$(NOECHO) $(NOOP)
X
X
X# --- MakeMaker realclean section:
X# Delete temporary files (via clean) and also delete dist files
Xrealclean purge ::  clean realclean_subdirs
X	- $(RM_F) \
X	  $(MAKEFILE_OLD) $(FIRST_MAKEFILE)
X	- $(RM_RF) \
X	  $(DISTVNAME)
X
X
X# --- MakeMaker metafile section:
Xmetafile : create_distdir
X	$(NOECHO) $(ECHO) Generating META.yml
X	$(NOECHO) $(ECHO) '# 
http://module-build.sourceforge.net/META-spec.html' > META_new.yml
X	$(NOECHO) $(ECHO) '#XXXXXXX This is a prototype!!!  It will change in 
the future!!! XXXXX#' >> META_new.yml
X	$(NOECHO) $(ECHO) 'name:         MIME-EncWords' >> META_new.yml
X	$(NOECHO) $(ECHO) 'version:      0.040' >> META_new.yml
X	$(NOECHO) $(ECHO) 'version_from: EncWords.pm' >> META_new.yml
X	$(NOECHO) $(ECHO) 'installdirs:  site' >> META_new.yml
X	$(NOECHO) $(ECHO) 'requires:' >> META_new.yml
X	$(NOECHO) $(ECHO) '    Encode:                        1.98' >> 
META_new.yml
X	$(NOECHO) $(ECHO) '    MIME::Base64:                  2.13' >> 
META_new.yml
X	$(NOECHO) $(ECHO) '    MIME::Charset:                 0.04.1' >> 
META_new.yml
X	$(NOECHO) $(ECHO) '    Test:                          0' >> META_new.yml
X	$(NOECHO) $(ECHO) '' >> META_new.yml
X	$(NOECHO) $(ECHO) 'distribution_type: module' >> META_new.yml
X	$(NOECHO) $(ECHO) 'generated_by: ExtUtils::MakeMaker version 6.30' >> 
META_new.yml
X	-$(NOECHO) $(MV) META_new.yml $(DISTVNAME)/META.yml
X
X
X# --- MakeMaker signature section:
Xsignature :
X	cpansign -s
X
X
X# --- MakeMaker dist_basics section:
Xdistclean :: realclean distcheck
X	$(NOECHO) $(NOOP)
X
Xdistcheck :
X	$(PERLRUN) "-MExtUtils::Manifest=fullcheck" -e fullcheck
X
Xskipcheck :
X	$(PERLRUN) "-MExtUtils::Manifest=skipcheck" -e skipcheck
X
Xmanifest :
X	$(PERLRUN) "-MExtUtils::Manifest=mkmanifest" -e mkmanifest
X
Xveryclean : realclean
X	$(RM_F) *~ *.orig */*~ */*.orig
X
X
X
X# --- MakeMaker dist_core section:
X
Xdist : $(DIST_DEFAULT) $(FIRST_MAKEFILE)
X	$(NOECHO) $(ABSPERLRUN) -l -e 'print '\''Warning: Makefile possibly 
out of date with $(VERSION_FROM)'\''' \
X	  -e '    if -e '\''$(VERSION_FROM)'\'' and -M '\''$(VERSION_FROM)'\'' 
< -M '\''$(FIRST_MAKEFILE)'\'';'
X
Xtardist : $(DISTVNAME).tar$(SUFFIX)
X	$(NOECHO) $(NOOP)
X
Xuutardist : $(DISTVNAME).tar$(SUFFIX)
X	uuencode $(DISTVNAME).tar$(SUFFIX) $(DISTVNAME).tar$(SUFFIX) > 
$(DISTVNAME).tar$(SUFFIX)_uu
X
X$(DISTVNAME).tar$(SUFFIX) : distdir
X	$(PREOP)
X	$(TO_UNIX)
X	$(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME)
X	$(RM_RF) $(DISTVNAME)
X	$(COMPRESS) $(DISTVNAME).tar
X	$(POSTOP)
X
Xzipdist : $(DISTVNAME).zip
X	$(NOECHO) $(NOOP)
X
X$(DISTVNAME).zip : distdir
X	$(PREOP)
X	$(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME)
X	$(RM_RF) $(DISTVNAME)
X	$(POSTOP)
X
Xshdist : distdir
X	$(PREOP)
X	$(SHAR) $(DISTVNAME) > $(DISTVNAME).shar
X	$(RM_RF) $(DISTVNAME)
X	$(POSTOP)
X
X
X# --- MakeMaker distdir section:
Xcreate_distdir :
X	$(RM_RF) $(DISTVNAME)
X	$(PERLRUN) "-MExtUtils::Manifest=manicopy,maniread" \
X		-e "manicopy(maniread(),'$(DISTVNAME)', '$(DIST_CP)');"
X
Xdistdir : create_distdir distmeta
X	$(NOECHO) $(NOOP)
X
X
X
X# --- MakeMaker dist_test section:
Xdisttest : distdir
X	cd $(DISTVNAME) && $(ABSPERLRUN) Makefile.PL "INSTALLDIRS=site" 
"CC=cc" "CCFLAGS=-O2 -fno-strict-aliasing -pipe " 
"PREFIX=/var/tmp/MIME-EncWords" 
"INSTALLPRIVLIB=/var/tmp/MIME-EncWords/lib" 
"INSTALLARCHLIB=/var/tmp/MIME-EncWords/lib"
X	cd $(DISTVNAME) && $(MAKE) $(PASTHRU)
X	cd $(DISTVNAME) && $(MAKE) test $(PASTHRU)
X
X
X
X# --- MakeMaker dist_ci section:
X
Xci :
X	$(PERLRUN) "-MExtUtils::Manifest=maniread" \
X	  -e "@all = keys %{ maniread() };" \
X	  -e "print(qq{Executing $(CI) @all\n}); system(qq{$(CI) @all});" \
X	  -e "print(qq{Executing $(RCS_LABEL) ...\n}); system(qq{$(RCS_LABEL) 
@all});"
X
X
X# --- MakeMaker distmeta section:
Xdistmeta : create_distdir metafile
X	$(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) 
-MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{META.yml} => q{Module 
meta-data (added by MakeMaker)}}) } ' \
X	  -e '    or print "Could not add META.yml to MANIFEST: $${'\''@'\''}\n"'
X
X
X
X# --- MakeMaker distsignature section:
Xdistsignature : create_distdir
X	$(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) 
-MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{SIGNATURE} => 
q{Public-key signature (added by MakeMaker)}}) } ' \
X	  -e '    or print "Could not add SIGNATURE to MANIFEST: $${'\''@'\''}\n"'
X	$(NOECHO) cd $(DISTVNAME) && $(TOUCH) SIGNATURE
X	cd $(DISTVNAME) && cpansign -s
X
X
X
X# --- MakeMaker install section:
X
Xinstall :: all pure_install doc_install
X	$(NOECHO) $(NOOP)
X
Xinstall_perl :: all pure_perl_install
X	$(NOECHO) $(NOOP)
X
Xinstall_site :: all pure_site_install
X	$(NOECHO) $(NOOP)
X
Xinstall_vendor :: all pure_vendor_install doc_vendor_install
X	$(NOECHO) $(NOOP)
X
Xpure_install :: pure_$(INSTALLDIRS)_install
X	$(NOECHO) $(NOOP)
X
Xdoc_install ::
X	$(NOECHO) $(NOOP)
X
Xpure__install : pure_site_install
X	$(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
X
Xdoc__install :
X	$(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
X
Xpure_perl_install ::
X	$(NOECHO) $(MOD_INSTALL) \
X		read $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist \
X		write $(DESTINSTALLARCHLIB)/auto/$(FULLEXT)/.packlist \
X		$(INST_LIB) $(DESTINSTALLPRIVLIB) \
X		$(INST_ARCHLIB) $(DESTINSTALLARCHLIB) \
X		$(INST_BIN) $(DESTINSTALLBIN) \
X		$(INST_SCRIPT) $(DESTINSTALLSCRIPT) \
X		$(INST_MAN1DIR) $(DESTINSTALLMAN1DIR) \
X		$(INST_MAN3DIR) $(DESTINSTALLMAN3DIR)
X	$(NOECHO) $(WARN_IF_OLD_PACKLIST) \
X		$(SITEARCHEXP)/auto/$(FULLEXT)
X
X
Xpure_site_install ::
X	$(NOECHO) $(MOD_INSTALL) \
X		read $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist \
X		write $(DESTINSTALLSITEARCH)/auto/$(FULLEXT)/.packlist \
X		$(INST_LIB) $(DESTINSTALLSITELIB) \
X		$(INST_ARCHLIB) $(DESTINSTALLSITEARCH) \
X		$(INST_BIN) $(DESTINSTALLSITEBIN) \
X		$(INST_SCRIPT) $(DESTINSTALLSCRIPT) \
X		$(INST_MAN1DIR) $(DESTINSTALLSITEMAN1DIR) \
X		$(INST_MAN3DIR) $(DESTINSTALLSITEMAN3DIR)
X	$(NOECHO) $(WARN_IF_OLD_PACKLIST) \
X		$(PERL_ARCHLIB)/auto/$(FULLEXT)
X
Xpure_vendor_install ::
X	$(NOECHO) $(MOD_INSTALL) \
X		read $(VENDORARCHEXP)/auto/$(FULLEXT)/.packlist \
X		write $(DESTINSTALLVENDORARCH)/auto/$(FULLEXT)/.packlist \
X		$(INST_LIB) $(DESTINSTALLVENDORLIB) \
X		$(INST_ARCHLIB) $(DESTINSTALLVENDORARCH) \
X		$(INST_BIN) $(DESTINSTALLVENDORBIN) \
X		$(INST_SCRIPT) $(DESTINSTALLSCRIPT) \
X		$(INST_MAN1DIR) $(DESTINSTALLVENDORMAN1DIR) \
X		$(INST_MAN3DIR) $(DESTINSTALLVENDORMAN3DIR)
X
Xdoc_perl_install ::
X	$(NOECHO) $(ECHO) Appending installation info to 
$(DESTINSTALLARCHLIB)/perllocal.pod
X	-$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
X	-$(NOECHO) $(DOC_INSTALL) \
X		"Module" "$(NAME)" \
X		"installed into" "$(INSTALLPRIVLIB)" \
X		LINKTYPE "$(LINKTYPE)" \
X		VERSION "$(VERSION)" \
X		EXE_FILES "$(EXE_FILES)" \
X		>> $(DESTINSTALLARCHLIB)/perllocal.pod
X
Xdoc_site_install ::
X	$(NOECHO) $(ECHO) Appending installation info to 
$(DESTINSTALLARCHLIB)/perllocal.pod
X	-$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
X	-$(NOECHO) $(DOC_INSTALL) \
X		"Module" "$(NAME)" \
X		"installed into" "$(INSTALLSITELIB)" \
X		LINKTYPE "$(LINKTYPE)" \
X		VERSION "$(VERSION)" \
X		EXE_FILES "$(EXE_FILES)" \
X		>> $(DESTINSTALLARCHLIB)/perllocal.pod
X
Xdoc_vendor_install ::
X	$(NOECHO) $(ECHO) Appending installation info to 
$(DESTINSTALLARCHLIB)/perllocal.pod
X	-$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
X	-$(NOECHO) $(DOC_INSTALL) \
X		"Module" "$(NAME)" \
X		"installed into" "$(INSTALLVENDORLIB)" \
X		LINKTYPE "$(LINKTYPE)" \
X		VERSION "$(VERSION)" \
X		EXE_FILES "$(EXE_FILES)" \
X		>> $(DESTINSTALLARCHLIB)/perllocal.pod
X
X
Xuninstall :: uninstall_from_$(INSTALLDIRS)dirs
X	$(NOECHO) $(NOOP)
X
Xuninstall_from_perldirs ::
X	$(NOECHO) $(UNINSTALL) $(PERL_ARCHLIB)/auto/$(FULLEXT)/.packlist
X
Xuninstall_from_sitedirs ::
X	$(NOECHO) $(UNINSTALL) $(SITEARCHEXP)/auto/$(FULLEXT)/.packlist
X
Xuninstall_from_vendordirs ::
X	$(NOECHO) $(UNINSTALL) $(VENDORARCHEXP)/auto/$(FULLEXT)/.packlist
X
X
X# --- MakeMaker force section:
X# Phony target to force checking subdirectories.
XFORCE:
X	$(NOECHO) $(NOOP)
X
X
X# --- MakeMaker perldepend section:
X
X
X# --- MakeMaker makefile section:
X# We take a very conservative approach here, but it's worth it.
X# We move Makefile to Makefile.old here to avoid gnu make looping.
X$(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP)
X	$(NOECHO) $(ECHO) "Makefile out-of-date with respect to $?"
X	$(NOECHO) $(ECHO) "Cleaning current config before rebuilding Makefile..."
X	-$(NOECHO) $(RM_F) $(MAKEFILE_OLD)
X	-$(NOECHO) $(MV)   $(FIRST_MAKEFILE) $(MAKEFILE_OLD)
X	- $(MAKE) $(USEMAKEFILE) $(MAKEFILE_OLD) clean $(DEV_NULL)
X	$(PERLRUN) Makefile.PL "INSTALLDIRS=site" "CC=cc" "CCFLAGS=-O2 
-fno-strict-aliasing -pipe " "PREFIX=/var/tmp/MIME-EncWords" 
"INSTALLPRIVLIB=/var/tmp/MIME-EncWords/lib" 
"INSTALLARCHLIB=/var/tmp/MIME-EncWords/lib"
X	$(NOECHO) $(ECHO) "==> Your Makefile has been rebuilt. <=="
X	$(NOECHO) $(ECHO) "==> Please rerun the $(MAKE) command.  <=="
X	false
X
X
X
X# --- MakeMaker staticmake section:
X
X# --- MakeMaker makeaperl section ---
XMAP_TARGET    = perl
XFULLPERL      = /usr/local/bin/perl5.8.8
X
X$(MAP_TARGET) :: static $(MAKE_APERL_FILE)
X	$(MAKE) $(USEMAKEFILE) $(MAKE_APERL_FILE) $@
X
X$(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) pm_to_blib
X	$(NOECHO) $(ECHO) Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET)
X	$(NOECHO) $(PERLRUNINST) \
X		Makefile.PL DIR= \
X		MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \
X		MAKEAPERL=1 NORECURS=1 CCCDLFLAGS= \
X		INSTALLDIRS=site \
X		CC=cc \
X		CCFLAGS='-O2 -fno-strict-aliasing -pipe ' \
X		PREFIX=/var/tmp/MIME-EncWords \
X		INSTALLPRIVLIB=/var/tmp/MIME-EncWords/lib \
X		INSTALLARCHLIB=/var/tmp/MIME-EncWords/lib
X
X
X# --- MakeMaker test section:
X
XTEST_VERBOSE=0
XTEST_TYPE=test_$(LINKTYPE)
XTEST_FILE = test.pl
XTEST_FILES = t/*.t
XTESTDB_SW = -d
X
Xtestdb :: testdb_$(LINKTYPE)
X
Xtest :: $(TEST_TYPE)
X
Xtest_dynamic :: pure_all
X	PERL_DL_NONLAZY=1 $(FULLPERLRUN) "-MExtUtils::Command::MM" "-e" 
"test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" 
$(TEST_FILES)
X
Xtestdb_dynamic :: pure_all
X	PERL_DL_NONLAZY=1 $(FULLPERLRUN) $(TESTDB_SW) "-I$(INST_LIB)" 
"-I$(INST_ARCHLIB)" $(TEST_FILE)
X
Xtest_ : test_dynamic
X
Xtest_static :: test_dynamic
Xtestdb_static :: testdb_dynamic
X
X
X# --- MakeMaker ppd section:
X# Creates a PPD (Perl Package Description) for a binary distribution.
Xppd:
X	$(NOECHO) $(ECHO) '<SOFTPKG NAME="$(DISTNAME)" VERSION="0,040,0,0">' > 
$(DISTNAME).ppd
X	$(NOECHO) $(ECHO) '    <TITLE>$(DISTNAME)</TITLE>' >> $(DISTNAME).ppd
X	$(NOECHO) $(ECHO) '    <ABSTRACT>deal with RFC-1522 encoded words 
(improved)</ABSTRACT>' >> $(DISTNAME).ppd
X	$(NOECHO) $(ECHO) '    <AUTHOR></AUTHOR>' >> $(DISTNAME).ppd
X	$(NOECHO) $(ECHO) '    <IMPLEMENTATION>' >> $(DISTNAME).ppd
X	$(NOECHO) $(ECHO) '        <DEPENDENCY NAME="Encode" 
VERSION="1,98,0,0" />' >> $(DISTNAME).ppd
X	$(NOECHO) $(ECHO) '        <DEPENDENCY NAME="MIME-Base64" 
VERSION="2,13,0,0" />' >> $(DISTNAME).ppd
X	$(NOECHO) $(ECHO) '        <DEPENDENCY NAME="MIME-Charset" 
VERSION="0,04,1,0" />' >> $(DISTNAME).ppd
X	$(NOECHO) $(ECHO) '        <DEPENDENCY NAME="Test" VERSION="0,0,0,0" 
/>' >> $(DISTNAME).ppd
X	$(NOECHO) $(ECHO) '        <OS NAME="$(OSNAME)" />' >> $(DISTNAME).ppd
X	$(NOECHO) $(ECHO) '        <ARCHITECTURE NAME="i386-freebsd-64int" />' 
 >> $(DISTNAME).ppd
X	$(NOECHO) $(ECHO) '        <CODEBASE HREF="" />' >> $(DISTNAME).ppd
X	$(NOECHO) $(ECHO) '    </IMPLEMENTATION>' >> $(DISTNAME).ppd
X	$(NOECHO) $(ECHO) '</SOFTPKG>' >> $(DISTNAME).ppd
X
X
X# --- MakeMaker pm_to_blib section:
X
Xpm_to_blib : $(TO_INST_PM)
X	$(NOECHO) $(ABSPERLRUN) -MExtUtils::Install -e 'pm_to_blib({@ARGV}, 
'\''$(INST_LIB)/auto'\'', '\''$(PM_FILTER)'\'')' \
X	  EncWords.pm $(INST_LIB)/MIME/EncWords.pm
X	$(NOECHO) $(TOUCH) pm_to_blib
X
X
X# --- MakeMaker selfdocument section:
X
X
X# --- MakeMaker postamble section:
X
X
X# End.
END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/Makefile
echo c - p5-MIME-EncWords/work/MIME-EncWords-0.040/blib
mkdir -p p5-MIME-EncWords/work/MIME-EncWords-0.040/blib > /dev/null 2>&1
echo c - p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib
mkdir -p p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib > /dev/null 2>&1
echo c - p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/MIME
mkdir -p p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/MIME > 
/dev/null 2>&1
echo x - p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/MIME/.exists
sed 's/^X//' 
 >p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/MIME/.exists << 
'END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/MIME/.exists'
END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/MIME/.exists
echo x - p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/MIME/EncWords.pm
sed 's/^X//' 
 >p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/MIME/EncWords.pm << 
'END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/MIME/EncWords.pm'
X
Xpackage MIME::EncWords;
Xuse 5.005;
X
X=head1 NAME
X
XMIME::EncWords - deal with RFC-1522 encoded words (improved)
X
X=head1 SYNOPSIS
X
XI<L<MIME::EncWords> is aimed to be another implimentation
Xof L<MIME::Words> so that it will achive more exact conformance with
XMIME specifications.  Additionally, it contains some improvements.
XFollowing synopsis and descriptions are inherited from its inspirer,
Xwith description of improvements and clarifications added.>
X
XBefore reading further, you should see L<MIME::Tools> to make sure that
Xyou understand where this module fits into the grand scheme of things.
XGo on, do it now.  I'll wait.
X
XReady?  Ok...
X
X    use MIME::EncWords qw(:all);
X
X    ### Decode the string into another string, forgetting the charsets:
X    $decoded = decode_mimewords(
X          'To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld at dkuug.dk>',
X          );
X
X    ### Split string into array of decoded [DATA,CHARSET] pairs:
X    @decoded = decode_mimewords(
X          'To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld at dkuug.dk>',
X          );
X
X    ### Encode a single unsafe word:
X    $encoded = encode_mimeword("\xABFran\xE7ois\xBB");
X
X    ### Encode a string, trying to find the unsafe words inside it:
X    $encoded = encode_mimewords("Me and \xABFran\xE7ois\xBB in town");
X
X=head1 DESCRIPTION
X
XFellow Americans, you probably won't know what the hell this module
Xis for.  Europeans, Russians, et al, you probably do.  C<:-)>.
X
XFor example, here's a valid MIME header you might get:
X
X      From: =?US-ASCII?Q?Keith_Moore?= <moore at cs.utk.edu>
X      To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld at dkuug.dk>
X      CC: =?ISO-8859-1?Q?Andr=E9_?= Pirard <PIRARD at vm1.ulg.ac.be>
X      Subject: =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=
X       =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=
X       =?US-ASCII?Q?.._cool!?=
X
XThe fields basically decode to (sorry, I can only approximate the
XLatin characters with 7 bit sequences /o and 'e):
X
X      From: Keith Moore <moore at cs.utk.edu>
X      To: Keld J/orn Simonsen <keld at dkuug.dk>
X      CC: Andr'e  Pirard <PIRARD at vm1.ulg.ac.be>
X      Subject: If you can read this you understand the example... cool!
X
XB<Supplement>: Fellow Americans, Europeans, you probably won't know
Xwhat the hell this module is for.  East Asians, et al, you probably do.
XC<:-)>.
X
XFor example, here's a valid MIME header you might get:
X
X      Subject: =?EUC-KR?B?sNTAuLinKGxhemluZXNzKSwgwvzB9ri7seIoaW1w?=
X       =?EUC-KR?B?YXRpZW5jZSksILGzuLgoaHVicmlzKQ==?=
X
XThe fields basically decode to (sorry, I cannot approximate the
Xnon-Latin multibyte characters with any 7 bit sequences):
X
X      Subject: ???(laziness), ????(impatience), ??(hubris)
X
X=head1 PUBLIC INTERFACE
X
X=over 4
X
X=cut
X
X### Pragmas:
Xuse strict;
Xuse vars qw($VERSION @EXPORT_OK %EXPORT_TAGS @ISA);
X
X### Exporting:
Xuse Exporter;
X
X%EXPORT_TAGS = (all => [qw(decode_mimewords
X			   encode_mimeword
X			   encode_mimewords)]);
XExporter::export_ok_tags(qw(all));
X
X### Inheritance:
X at ISA = qw(Exporter);
X
X### Other modules:
Xuse Carp;
Xuse MIME::Base64;
Xuse MIME::Charset qw(:trans);
X
Xmy @ENCODE_SUBS = qw(FB_CROAK decode encode from_to is_utf8 resolve_alias);
Xif (MIME::Charset::USE_ENCODE) {
X    eval "use ".MIME::Charset::USE_ENCODE." \@ENCODE_SUBS;";
X} else {
X    require MIME::Charset::_Compat;
X    for my $sub (@ENCODE_SUBS) {
X        no strict "refs";
X        *{$sub} = \&{"MIME::Charset::_Compat::$sub"};
X    }
X}
X
X#------------------------------
X#
X# Globals...
X#
X#------------------------------
X
X### The package version, both in 1.23 style *and* usable by MakeMaker:
X$VERSION = '0.040';
X
X### Nonprintables (controls + x7F + 8bit):
X#my $NONPRINT = "\\x00-\\x1F\\x7F-\\xFF";
Xmy $PRINTABLE = "\\x21-\\x7E";
Xmy $NONPRINT = qr{[^$PRINTABLE]}; # Improvement: Unicode support.
Xmy $UNSAFE = qr{[^\x01-\x20$PRINTABLE]};
Xmy $WIDECHAR = qr{[^\x00-\xFF]};
X
X### Max line length:
Xmy $MAXLINELEN = 76;
X
X#------------------------------
X
X# _decode_B STRING
X#     Private: used by _decode_header() to decode "B" encoding.
X#     Improvement by this module: sanity check on encoded sequence.
Xsub _decode_B {
X    my $str = shift;
X    unless ((length($str) % 4 == 0) and
X	$str =~ m|^[A-Za-z0-9+/]+={0,2}$|) {
X	return undef;
X    }
X    return decode_base64($str);
X}
X
X# _decode_Q STRING
X#     Private: used by _decode_header() to decode "Q" encoding, which is
X#     almost, but not exactly, quoted-printable.  :-P
Xsub _decode_Q {
X    my $str = shift;
X    $str =~ s/_/\x20/g;					# RFC-1522, Q rule 2
X    $str =~ s/=([\da-fA-F]{2})/pack("C", hex($1))/ge;	# RFC-1522, Q rule 1
X    $str;
X}
X
X# _encode_B STRING
X#     Private: used by encode_mimeword() to encode "B" encoding.
Xsub _encode_B {
X    my $str = shift;
X    encode_base64($str, '');
X}
X
X# _encode_Q STRING
X#     Private: used by encode_mimeword() to encode "Q" encoding, which is
X#     almost, but not exactly, quoted-printable.  :-P
X#     Improvement by this module: Spaces are escaped by ``_''.
Xsub _encode_Q {
X    my $str = shift;
X    # $str =~ s{([_\?\=$NONPRINT])}{sprintf("=%02X", ord($1))}eog;
X    $str =~ s{(\x20)|([_?=]|$NONPRINT)}{
X	defined $1? "_": sprintf("=%02X", ord($2))
X	}eog;
X    $str;
X}
X
X#------------------------------
X
X=item decode_mimewords ENCODED, [OPTS...]
X
XI<Function.>
XGo through the string looking for RFC-1522-style "Q"
X(quoted-printable, sort of) or "B" (base64) encoding, and decode them.
X
XB<In an array context,> splits the ENCODED string into a list of decoded
XC<[DATA, CHARSET]> pairs, and returns that list.  Unencoded
Xdata are returned in a 1-element array C<[DATA]>, giving an effective
XCHARSET of C<undef>.
X
X    $enc = '=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld at dkuug.dk>';
X    foreach (decode_mimewords($enc)) {
X        print "", ($_[1] || 'US-ASCII'), ": ", $_[0], "\n";
X    }
X
XB<In a scalar context,> joins the "data" elements of the above
Xlist together, and returns that.  I<Warning: this is information-lossy,>
Xand probably I<not> what you want, but if you know that all charsets
Xin the ENCODED string are identical, it might be useful to you.
X(Before you use this, please see L<MIME::WordDecoder/unmime>,
Xwhich is probably what you want.)
XB<Note>: See also "Charset" option below.
X
XIn the event of a syntax error, $@ will be set to a description
Xof the error, but parsing will continue as best as possible (so as to
Xget I<something> back when decoding headers).
X$@ will be false if no error was detected.
X
XAny arguments past the ENCODED string are taken to define a hash of 
options:
X
X=over 4
X
X=item Charset
X
XB<Improvement by this module>:
XName of character set by which data elements in scalar context
Xwill be converted.
XIf this option is specified as special value C<"_UNICODE_">,
Xreturned value will be Unicode string.
X
XWhen Unicode/multibyte support is disabled
X(see L<MIME::Charset/USE_ENCODE>),
Xthis option will not have any effects.
X
XB<Note>:
XThis feature is still information-lossy, I<except> when C<"_UNICODE_"> is
Xspecified.
X
X=item Field
X
XName of the mail field this string came from.  I<Currently ignored.>
X
X=back
X
XB<Improvement by this module>:
XAdjacent encoded-words with same charset will be concatenated
Xto handle multibyte sequences safely.
X
XB<Change by this module>:
XMalformed base64 encoded-words will be kept encoded.
XIn this case $@ will be set.
X
XB<Compatibility with MIME::Words>:
XWhitespaces surrounding unencoded data will not be stripped.
X
X=cut
X
Xsub decode_mimewords {
X    my $encstr = shift;
X    my %params = @_;
X    my $cset = $params{"Charset"};
X    my @tokens;
X    $@ = '';           ### error-return
X
X    ### Decode:
X    my ($word, $charset, $encoding, $enc, $dec);
X    my $spc = '';
X    pos($encstr) = 0;
X    while (1) {
X        last if (pos($encstr) >= length($encstr));
X        my $pos = pos($encstr);               ### save it
X
X        ### Case 1: are we looking at "=?..?..?="?
X        if ($encstr =~    m{\G             # from where we left off..
X                            =\?([^?]*)     # "=?" + charset +
X                             \?([bq])      #  "?" + encoding +
X                             \?([^?]+)     #  "?" + data maybe with spcs +
X                             \?=           #  "?="
X			     ([\r\n\t ]*)
X                            }xgi) {
X	    ($word, $charset, $encoding, $enc) = ($&, $1, lc($2), $3);
X	    my $tspc = $4;
X	    if ($encoding eq 'q') {
X		$dec = _decode_Q($enc);
X	    } else {
X		$dec = _decode_B($enc);
X	    }
X	    unless (defined $dec) {
X		$@ .= qq|Illegal sequence in "$word" (pos $pos)\n|;
X		push @tokens, [$spc.$word];
X		$spc = '';
X		next;
X	    }
X
X	    if (scalar(@tokens) and
X		lc($charset) eq lc(${$tokens[-1]}[1]) and
X		resolve_alias($charset)) { # Concat words if possible.
X		${$tokens[-1]}[0] .= $dec;
X	    } else {
X		push @tokens, [$dec, $charset];
X	    }
X	    $spc = $tspc;
X            next;
X        }
X
X        ### Case 2: are we looking at a bad "=?..." prefix?
X        ### We need this to detect problems for case 3, which stops at 
"=?":
X        pos($encstr) = $pos;               # reset the pointer.
X        if ($encstr =~ m{\G=\?}xg) {
X            $@ .= qq|unterminated "=?..?..?=" in "$encstr" (pos $pos)\n|;
X            push @tokens, [$spc.'=?'];
X	    $spc = '';
X            next;
X        }
X
X        ### Case 3: are we looking at ordinary text?
X        pos($encstr) = $pos;               # reset the pointer.
X        if ($encstr =~ m{\G                # from where we left off...
X                         (.*?              #   shortest possible string,
X                          \n*)             #   followed by 0 or more NLs,
X                         (?=(\Z|=\?))      # terminated by "=?" or EOS
X                        }xgs) {
X            length($1) or croak "MIME::EncWords: internal logic err: 
empty token\n";
X            push @tokens, [$spc.$1];
X	    $spc = '';
X            next;
X        }
X
X        ### Case 4: bug!
X        croak "MIME::EncWords: unexpected case:\n($encstr) pos $pos\n\t".
X            "Please alert developer.\n";
X    }
X    push @tokens, [$spc] if $spc;
X
X    return (wantarray ? @tokens : join('',map {
X	&_convert($_->[0], $_->[1], $cset)
X	} @tokens));
X}
X
X#------------------------------
X
X# _convert RAW, FROMCHARSET, TOCHARSET
X#     Private: used by encode_mimewords() to convert string by other 
charset
X#     or to decode to Unicode.
X#     When source charset is unknown and Unicode string is requested, 
at first
X#     try well-formed UTF-8 then fallback to ISO-8859-1 so that almost all
X#     non-ASCII bytes will be preserved.
Xsub _convert($$$) {
X    my $s = shift;
X    my $charset = shift || "";
X    my $cset = shift;
X    return $s unless MIME::Charset::USE_ENCODE;
X    return $s unless $cset;
X    return $s if uc($charset) eq uc($cset);
X
X    my $preserveerr = $@;
X
X    my $converted = $s;
X    if (is_utf8($s) or $s =~ $WIDECHAR) {
X	if ($cset ne "_UNICODE_") {
X	    $converted = encode($cset, $converted);
X	}
X    } elsif ($cset eq "_UNICODE_") {
X	if (!resolve_alias($charset)) {
X	    if ($s =~ $UNSAFE) {
X		$@ = '';
X		eval {
X		    $converted = decode("UTF-8", $converted, FB_CROAK());
X		};
X		if ($@) {
X		    $converted = $s;
X		    $converted = decode("ISO-8859-1", $converted);
X		}
X	    }
X	} else {
X	    $converted = decode($charset, $converted);
X	}
X    } elsif (resolve_alias($charset)) {
X	from_to($converted, $charset, $cset);
X    }
X
X    $@ = $preserveerr;
X    return $converted;
X}
X
X#------------------------------
X
X=item encode_mimeword RAW, [ENCODING], [CHARSET]
X
XI<Function.>
XEncode a single RAW "word" that has unsafe characters.
XThe "word" will be encoded in its entirety.
X
X    ### Encode "<<Franc,ois>>":
X    $encoded = encode_mimeword("\xABFran\xE7ois\xBB");
X
XYou may specify the ENCODING (C<"Q"> or C<"B">), which defaults to C<"Q">.
XB<Improvement by this module>:
XYou may also specify it as ``special'' value: C<"S"> to choose shorter
Xone of either C<"Q"> or C<"B">.
X
XYou may specify the CHARSET, which defaults to C<iso-8859-1>.
X
XB<Change by this module>:
XSpaces will be escaped with ``_'' by C<"Q"> encoding.
X
X=cut
X
Xsub encode_mimeword {
X    my $word = shift;
X    my $encoding = uc(shift || 'Q');
X    my $charset  = uc(shift || 'ISO-8859-1');
X
X    my $encstr;
X    if ($encoding eq 'Q') {
X	$encstr = &_encode_Q($word);
X    } elsif ($encoding eq "S") {
X	if (encoded_header_len($word, "B", $charset) <
X	    encoded_header_len($word, "Q", $charset)) {
X	    $encoding = "B";
X	    $encstr = &_encode_B($word);
X	} else {
X	    $encoding = "Q";
X	    $encstr = &_encode_Q($word);
X	}
X    } else { # "B"
X	$encoding = "B";
X	$encstr = &_encode_B($word);
X    }
X
X    "=?$charset?$encoding?$encstr?=";
X}
X
X#------------------------------
X
X=item encode_mimewords RAW, [OPTS]
X
XI<Function.>
XGiven a RAW string, try to find and encode all "unsafe" sequences
Xof characters:
X
X    ### Encode a string with some unsafe "words":
X    $encoded = encode_mimewords("Me and \xABFran\xE7ois\xBB");
X
XReturns the encoded string.
X
XB<Improvement by this module>:
XRAW may be a Unicode string when Unicode/multibyte support is enabled
X(see L<MIME::Charset/USE_ENCODE>).
XFurthermore, RAW may be a reference to that returned
Xby L<"decode_mimewords"> on array context.  In latter case "Charset"
Xoption (see below) will be overridden (see also notes below).
X
XAny arguments past the RAW string are taken to define a hash of options:
X
X=over 4
X
X=item Charset
X
XEncode all unsafe stuff with this charset.  Default is 'ISO-8859-1',
Xa.k.a. "Latin-1".
X
X=item Detect7bit
X
XB<Improvement by this modlue>:
XWhen "Encoding" option (see below) is specified as C<"a"> and "Charset"
Xoption is unknown, try to detect 7-bit charset on given RAW string.
XDefault is C<"YES">.
XWhen Unicode/multibyte support is disabled,
Xthis option will not have any effects
X(see L<MIME::Charset/USE_ENCODE>).
X
X=item Encoding
X
XThe encoding to use, C<"q"> or C<"b">.  The default is C<"q">.
XB<Improvement by this module>:
XYou may also specify ``special'' values: C<"a"> will automatically choose
Xrecommended encoding to use (with charset conversion if alternative
Xcharset is recommended: see L<MIME::Charset>);
XC<"s"> will choose shorter one of either C<"q"> or C<"b">.
X
X=item Field
X
XName of the mail field this string will be used in.
XB<Improvement by this module>:
XLength of mail field name will be considered in the first line of
Xencoded header.
X
X=item Minimal
X
XB<Improvement by this module>:
XTakes care of natural word separators (i.e. whitespaces)
Xin the text to be encoded.
XIf C<"NO"> is specified, this module will encode whole text
X(if encoding needed) not regarding whitespaces;
Xencoded-words exceeding line length will be splitted based only on their
Xlengths.
XDefault is C<"YES">.
X
XB<Note>:
XAs of release 0.040, default has been changed to C<"YES"> to ensure
Xcompatibility with MIME::Words.
XOn earlier releases, this option was fixed to be C<"NO">.
X
X=back
X
XB<Notes on improvement by this module>:
XWhen RAW is an arrayref,
Xadjacent encoded-words are concatenated.  Then they are splitted taking
Xcare of character boundaries of multibyte sequences, when Unicode/multibyte
Xsupport is enabled.
XPortions for unencoded data should include surrounding whitespace(s), or
Xthey will be merged into adjoining encoded word(s).
X
X=cut
X
Xsub encode_mimewords  {
X    my $words = shift;
X    my %params = @_;
X    my $charset = uc($params{'Charset'});
X    my $detect7bit = uc($params{'Detect7bit'} || "YES");
X    my $encoding = uc($params{'Encoding'});
X    my $header_name = $params{'Field'};
X    my $minimal = uc($params{'Minimal'} || "YES");
X    my $firstlinelen = $MAXLINELEN;
X    if ($header_name) {
X	$firstlinelen -= length($header_name.': ');
X    }
X
X    unless (ref($words) eq "ARRAY") {
X	if ($minimal eq "YES") {
X	    my @words = map {[$_, $charset]} split(/((?:\A|[\t ])[\t 
\x21-\x7E]+(?:[\t ]|\Z))/, $words);
X	    $words = \@words;
X	} else {
X	    $words = [[$words, $charset]];
X	}
X    }
X
X    # Translate / concatenate words.
X    my @triplets;
X    foreach (@$words) {
X	my ($s, $cset) = @$_;
X	my $enc;
X
X	next unless length($s);
X
X	# Unicode string should be encoded by given charset.
X	# Unsupported charset will be fallbacked to UTF-8.
X	if (is_utf8($s) or $s =~ $WIDECHAR) {
X	    unless (resolve_alias($cset)) {
X		if ($s !~ $UNSAFE) {
X		    $cset = "US-ASCII";
X		} else {
X		    $cset = "UTF-8";
X		}
X	    }
X	    $s = encode($cset, $s);
X	}
X
X	# Determine charset and encoding.
X	if ($encoding eq "A") {
X	    ($s, $cset, $enc) =
X		header_encode($s, $cset || $charset,
X			      Detect7bit => $detect7bit);
X	} else {
X	    $cset ||= ($charset || ($s !~ $UNSAFE)? "US-ASCII": "ISO-8859-1");
X	    $enc = $encoding ||
X		(($s !~ $UNSAFE and $cset eq "US-ASCII")? undef: "Q");
X	}
X
X	# Concatenate adjacent ``words'' so that multibyte sequences will
X	# be handled safely.
X	# Note: Encoded-word and unencoded text must not adjoin without
X	# separating whitespace(s).
X	if (scalar(@triplets)) {
X	    my ($last, $lastenc, $lastcset) = @{$triplets[-1]};
X	    if (uc($lastcset) eq uc($cset) and uc($lastenc) eq uc($enc) and
X		resolve_alias($cset)) {
X		${$triplets[-1]}[0] .= $s;
X		next;
X	    } elsif (!$lastenc and $enc and $last !~ /[\t ]$/) {
X		if ($last =~ /^(.*)[\t ]([$PRINTABLE]+)$/s) {
X		    ${$triplets[-1]}[0] = $1." ";
X		    $s = $2.$s;
X		} elsif (uc($lastcset) eq "US-ASCII") {
X		    ${$triplets[-1]}[0] .= $s;
X		    ${$triplets[-1]}[1] = $enc;
X		    ${$triplets[-1]}[2] = $cset;
X		    next;
X		}
X	    } elsif ($lastenc and !$enc and $s !~ /^[\t ]/) {
X		if ($s =~ /^([$PRINTABLE]+)[\t ](.*)$/s) {
X		    ${$triplets[-1]}[0] .= $1;
X		    $s = " ".$2;
X		} elsif (uc($cset) eq "US-ASCII") {
X		    ${$triplets[-1]}[0] .= $s;
X		    next;
X		}
X	    }
X	}
X	push @triplets, [$s, $enc, $cset];
X    }
X
X    # Split long ``words''.
X    my @splitted;
X    my $restlen = $firstlinelen;
X    my $lastlen = 0;
X    foreach (@triplets) {
X	my ($s, $enc, $cset) = @$_;
X
X	my $restlen = $restlen - $lastlen - 1;
X	if ($restlen < ($enc? encoded_header_len('', $enc, $cset): 1)) {
X	    $restlen = $MAXLINELEN - 1;
X	}
X
X	push @splitted, &_split($s, $enc, $cset, $restlen);
X	my ($last, $lastenc, $lastcset) = @{$splitted[-1]};
X	if ($lastenc) {
X	    $lastlen = encoded_header_len($last, $lastenc, $lastcset);
X	} else {
X	    $lastlen = length($last);
X	}
X    }
X
X    # Do encoding.
X    my @lines;
X    my $linelen = $firstlinelen;
X    foreach (@splitted) {
X	my ($str, $encoding, $charset) = @$_;
X	next unless length($str);
X
X	my $s;
X	if (!$encoding) {
X	    $s = $str;
X	} else {
X	    $s = &encode_mimeword($str, $encoding, $charset);
X	}
X
X	my $spc = (scalar(@lines) and $lines[-1] =~ /[\t ]$/)? '': ' ';
X	if (!scalar(@lines)) {
X	    $s =~ s/^[\r\n\t ]+//;
X	    push @lines, $s;
X	} elsif (length($lines[-1]) + length($s) <= $linelen) {
X	    $lines[-1] .= $spc.$s;
X	} else {
X	    $s =~ s/^[\r\n\t ]+//;
X	    push @lines, $s;
X	    $linelen = $MAXLINELEN - 1;
X	}
X    }
X
X    join("\n ", @lines);
X}
X
X#------------------------------
X
X# _split RAW, ENCODING, CHARSET, ROOM_OF_FIRST_LINE
X#     Private: used by encode_mimewords() to split a string into
X#     (encoded or non-encoded) words.
X#     Returns an array of arrayrefs [SUBSTRING, ENCODING, CHARSET].
Xsub _split {
X    my $str = shift;
X    my $encoding = shift;
X    my $charset = shift;
X    my $restlen = shift;
X
X    if (!$charset or $charset eq '8BIT') {	# Undecodable.
X	$str =~ s/[\r\n]+[\t ]*|\x00/ /g;	# Eliminate hostile characters.
X	return ([$str, undef, $charset]);
X    }
X    unless (resolve_alias($charset)) {		# Unsupported charset.
X	return ([$str, $encoding, $charset]);
X    }
X    if (!$encoding and $charset eq 'US-ASCII') {
X	return &_split_ascii($str, $restlen);
X    }
X
X    my (@splitted, $ustr, $first);
X    while (length($str)) {
X	if (encoded_header_len($str, $encoding, $charset) <= $restlen) {
X	    push @splitted, [$str, $encoding, $charset];
X	    last;
X	}
X	$ustr = $str;
X	$ustr = decode($charset, $ustr);
X	($first, $str) = &_clip_unsafe($ustr, $encoding, $charset, $restlen);
X	push @splitted, [$first, $encoding, $charset];
X	$restlen = $MAXLINELEN - 1;
X    }
X    return @splitted;
X}
X
X# _split_ascii RAW, ROOM_OF_FIRST_LINE
X#     Private: used by encode_mimewords() to split an US-ASCII string into
X#     (encoded or non-encoded) words.
X#     Returns an array of arrayrefs [SUBSTRING, ENCODING, "US-ASCII"],
X#     where ENCODING is either undef or (if any unsafe sequences are
X#     included) "Q".
Xsub _split_ascii {
X    my $s = shift;
X    my $restlen = shift || $MAXLINELEN - 1;
X
X    my @splitted;
X    foreach my $line (split(/[\r\n]+/, $s)) {
X	$line =~ s/^[\t ]+//;
X
X	if (length($line) < $restlen and $line !~ /=\?|$UNSAFE/) {
X	    push @splitted, [$line, undef, "US-ASCII"];
X	    $restlen = $MAXLINELEN - 1;
X	    next;
X	}
X
X        my ($spc, $enc);
X	foreach my $word (split(/([\t ]+)/, $line)) {
X	    if ($word =~ /[\t ]/) {
X		$spc = $word;
X		next;
X	    }
X
X	    $enc = ($word =~ /=\?|$UNSAFE/)? "Q": undef;
X	    if (scalar(@splitted)) {
X		my ($last, $lastenc, $lastcset) = @{$splitted[-1]};
X		my ($elen, $cont, $appe);
X
X		# Concatenate adjacent words so that encoded-word and
X		# unencoded text will adjoin with separating whitespace.
X		if (!$lastenc and !$enc) {
X		    $elen = length($spc.$word);
X		    ($cont, $appe) = ($spc.$word, "");
X		} elsif (!$lastenc and $enc) {
X		    $elen = length($spc) +
X			encoded_header_len($word, "Q", "US-ASCII");
X		    ($cont, $appe) = ($spc, $word);
X		} elsif ($lastenc and !$enc) {
X		    $elen = length($spc.$word);
X		    ($cont, $appe) = ("", $spc.$word);
X		} else {
X		    $elen = encoded_header_len($spc.$word, "Q",
X					       "US-ASCII") - 15;
X		    ($cont, $appe) = ($spc.$word, "");
X		}
X
X		if ($elen <= $restlen) {
X		    ${$splitted[-1]}[0] .= $cont if length($cont);
X		    push @splitted, [$appe, $enc, "US-ASCII"] if length($appe);
X		    $restlen -= $elen;
X		    next;
X		}
X		$restlen = $MAXLINELEN - 1;
X	    }
X	    push @splitted, [$word, $enc, "US-ASCII"];
X	    $restlen -= ($enc?
X		encoded_header_len($word, "Q", "US-ASCII"):
X		length($word));
X	}
X    }
X    return @splitted;
X}
X
X# _clip_unsafe UNICODE, ENCODING, CHARSET, ROOM_OF_FIRST_LINE
X#     Private: used by encode_mimewords() to bite off one encodable
X#     ``word'' from a Unicode string.
Xsub _clip_unsafe {
X    my $ustr = shift;
X    my $encoding = shift;
X    my $charset = shift;
X    my $restlen = shift;
X    return ("", "") unless length($ustr);
X
X    # Seek maximal division point.
X    my ($shorter, $longer) = (0, length($ustr));
X    while ($shorter < $longer) {
X	my $cur = int(($shorter + $longer + 1) / 2);
X	my $enc = encode($charset, substr($ustr, 0, $cur));
X	my $elen = encoded_header_len($enc, $encoding, $charset);
X	if ($elen <= $restlen) {
X	    $shorter = $cur;
X	} else {
X	    $longer = $cur - 1;
X	}
X    }
X
X    # Make sure that combined characters won't be divided.
X    my ($fenc, $renc);
X    my $max = length($ustr);
X    while (1) {
X	$@ = '';
X	eval {
X	    ($fenc, $renc) =
X		(substr($ustr, 0, $shorter), substr($ustr, $shorter));
X	    $fenc = encode($charset, $fenc, FB_CROAK());
X	    $renc = encode($charset, $renc, FB_CROAK());
X	};
X	last unless ($@);
X
X	$shorter++;
X	unless ($shorter < $max) { # Unencodable characters are included.
X	    return (encode($charset, $ustr), "");
X	}
X    }
X
X    if (length($fenc)) {
X	return ($fenc, $renc);
X    } else {
X	return ($renc, "");
X    }
X}
X
X#------------------------------
X
X=back
X
X=head1 VERSION
X
XConsult $VERSION variable.
X
XDevelopment versions of this module may be found at
XL<http://hatuka.nezumi.nu/repos/MIME-EncWords/>.
X
X=head1 SEE ALSO
X
XL<MIME::Charset>,
XL<MIME::Tools>
X
X=head1 AUTHORS
X
XThe original version of function decode_mimewords() is derived from
XL<MIME::Words> module that was written by:
X    Eryq (F<eryq at zeegee.com>), ZeeGee Software Inc 
(F<http://www.zeegee.com>).
X    David F. Skoll (dfs at roaringpenguin.com) http://www.roaringpenguin.com
X
XOther stuff are rewritten or added by:
X    Hatuka*nezumi - IKEDA Soji <hatuka(at)nezumi.nu>.
X
XAll rights reserved.  This program is free software; you can redistribute
Xit and/or modify it under the same terms as Perl itself.
X
X=cut
X
X1;
END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/MIME/EncWords.pm
echo c - p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/auto
mkdir -p p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/auto > 
/dev/null 2>&1
echo c - p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/auto/MIME
mkdir -p p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/auto/MIME > 
/dev/null 2>&1
echo c - 
p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/auto/MIME/EncWords
mkdir -p 
p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/auto/MIME/EncWords > 
/dev/null 2>&1
echo x - 
p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/auto/MIME/EncWords/.exists
sed 's/^X//' 
 >p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/auto/MIME/EncWords/.exists 
<< 
'END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/auto/MIME/EncWords/.exists'
END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/lib/auto/MIME/EncWords/.exists
echo c - p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/arch
mkdir -p p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/arch > /dev/null 
2>&1
echo x - p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/arch/.exists
sed 's/^X//' 
 >p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/arch/.exists << 
'END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/arch/.exists'
END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/arch/.exists
echo c - p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/arch/auto
mkdir -p p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/arch/auto > 
/dev/null 2>&1
echo c - p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/arch/auto/MIME
mkdir -p p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/arch/auto/MIME > 
/dev/null 2>&1
echo c - 
p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/arch/auto/MIME/EncWords
mkdir -p 
p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/arch/auto/MIME/EncWords > 
/dev/null 2>&1
echo x - 
p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/arch/auto/MIME/EncWords/.exists
sed 's/^X//' 
 >p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/arch/auto/MIME/EncWords/.exists 
<< 
'END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/arch/auto/MIME/EncWords/.exists'
END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/arch/auto/MIME/EncWords/.exists
echo c - p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/bin
mkdir -p p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/bin > /dev/null 2>&1
echo x - p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/bin/.exists
sed 's/^X//' >p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/bin/.exists 
<< 'END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/bin/.exists'
END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/bin/.exists
echo c - p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/script
mkdir -p p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/script > 
/dev/null 2>&1
echo x - p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/script/.exists
sed 's/^X//' 
 >p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/script/.exists << 
'END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/script/.exists'
END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/script/.exists
echo c - p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/man1
mkdir -p p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/man1 > /dev/null 
2>&1
echo x - p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/man1/.exists
sed 's/^X//' 
 >p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/man1/.exists << 
'END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/man1/.exists'
END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/man1/.exists
echo c - p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/man3
mkdir -p p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/man3 > /dev/null 
2>&1
echo x - p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/man3/.exists
sed 's/^X//' 
 >p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/man3/.exists << 
'END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/man3/.exists'
END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/man3/.exists
echo x - 
p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/man3/MIME::EncWords.3
sed 's/^X//' 
 >p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/man3/MIME::EncWords.3 
<< 
'END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/man3/MIME::EncWords.3'
X.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
X.\"
X.\" Standard preamble:
X.\" 
========================================================================
X.de Sh \" Subsection heading
X.br
X.if t .Sp
X.ne 5
X.PP
X\fB\\$1\fR
X.PP
X..
X.de Sp \" Vertical space (when we can't use .PP)
X.if t .sp .5v
X.if n .sp
X..
X.de Vb \" Begin verbatim text
X.ft CW
X.nf
X.ne \\$1
X..
X.de Ve \" End verbatim text
X.ft R
X.fi
X..
X.\" Set up some character translations and predefined strings.  \*(-- will
X.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
X.\" double quote, and \*(R" will give a right double quote.  | will give a
X.\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is 
used to
X.\" do unbreakable dashes and therefore won't be available.  \*(C` and 
\*(C'
X.\" expand to `' in nroff, nothing in troff, for use with C<>.
X.tr \(*W-|\(bv\*(Tr
X.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
X.ie n \{\
X.    ds -- \(*W-
X.    ds PI pi
X.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 
10 pitch
X.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 
12 pitch
X.    ds L" ""
X.    ds R" ""
X.    ds C` ""
X.    ds C' ""
X'br\}
X.el\{\
X.    ds -- \|\(em\|
X.    ds PI \(*p
X.    ds L" ``
X.    ds R" ''
X'br\}
X.\"
X.\" If the F register is turned on, we'll generate index entries on 
stderr for
X.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
X.\" entries marked with X<> in POD.  Of course, you'll have to process the
X.\" output yourself in some meaningful fashion.
X.if \nF \{\
X.    de IX
X.    tm Index:\\$1\t\\n%\t"\\$2"
X..
X.    nr % 0
X.    rr F
X.\}
X.\"
X.\" For nroff, turn off justification.  Always turn off hyphenation; it 
makes
X.\" way too many mistakes in technical documents.
X.hy 0
X.if n .na
X.\"
X.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
X.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
X.    \" fudge factors for nroff and troff
X.if n \{\
X.    ds #H 0
X.    ds #V .8m
X.    ds #F .3m
X.    ds #[ \f1
X.    ds #] \fP
X.\}
X.if t \{\
X.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
X.    ds #V .6m
X.    ds #F 0
X.    ds #[ \&
X.    ds #] \&
X.\}
X.    \" simple accents for nroff and troff
X.if n \{\
X.    ds ' \&
X.    ds ` \&
X.    ds ^ \&
X.    ds , \&
X.    ds ~ ~
X.    ds /
X.\}
X.if t \{\
X.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
X.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
X.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
X.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
X.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
X.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
X.\}
X.    \" troff and (daisy-wheel) nroff accents
X.ds : 
\\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
X.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
X.ds o 
\\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
X.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
X.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
X.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
X.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
X.ds ae a\h'-(\w'a'u*4/10)'e
X.ds Ae A\h'-(\w'A'u*4/10)'E
X.    \" corrections for vroff
X.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
X.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
X.    \" for low resolution devices (crt and lpr)
X.if \n(.H>23 .if \n(.V>19 \
X\{\
X.    ds : e
X.    ds 8 ss
X.    ds o a
X.    ds d- d\h'-1'\(ga
X.    ds D- D\h'-1'\(hy
X.    ds th \o'bp'
X.    ds Th \o'LP'
X.    ds ae ae
X.    ds Ae AE
X.\}
X.rm #[ #] #H #V #F C
X.\" 
========================================================================
X.\"
X.IX Title "EncWords 3"
X.TH EncWords 3 "2006-11-16" "perl v5.8.8" "User Contributed Perl 
Documentation"
X.SH "NAME"
XMIME::EncWords \- deal with RFC\-1522 encoded words (improved)
X.SH "SYNOPSIS"
X.IX Header "SYNOPSIS"
X\&\fIMIME::EncWords is aimed to be another implimentation
Xof MIME::Words so that it will achive more exact conformance with
X\&\s-1MIME\s0 specifications.  Additionally, it contains some improvements.
XFollowing synopsis and descriptions are inherited from its inspirer,
Xwith description of improvements and clarifications added.\fR
X.PP
XBefore reading further, you should see MIME::Tools to make sure that
Xyou understand where this module fits into the grand scheme of things.
XGo on, do it now.  I'll wait.
X.PP
XReady?  Ok...
X.PP
X.Vb 1
X\&    use MIME::EncWords qw(:all);
X.Ve
X.PP
X.Vb 4
X\&    ### Decode the string into another string, forgetting the charsets:
X\&    $decoded = decode_mimewords(
X\&          'To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld at dkuug.dk>',
X\&          );
X.Ve
X.PP
X.Vb 4
X\&    ### Split string into array of decoded [DATA,CHARSET] pairs:
X\&    @decoded = decode_mimewords(
X\&          'To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld at dkuug.dk>',
X\&          );
X.Ve
X.PP
X.Vb 2
X\&    ### Encode a single unsafe word:
X\&    $encoded = encode_mimeword("\exABFran\exE7ois\exBB");
X.Ve
X.PP
X.Vb 2
X\&    ### Encode a string, trying to find the unsafe words inside it:
X\&    $encoded = encode_mimewords("Me and \exABFran\exE7ois\exBB in town");
X.Ve
X.SH "DESCRIPTION"
X.IX Header "DESCRIPTION"
XFellow Americans, you probably won't know what the hell this module
Xis for.  Europeans, Russians, et al, you probably do. 
\f(CW\*(C`:\-)\*(C'\fR.
X.PP
XFor example, here's a valid \s-1MIME\s0 header you might get:
X.PP
X.Vb 6
X\&      From: =?US-ASCII?Q?Keith_Moore?= <moore at cs.utk.edu>
X\&      To: =?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld at dkuug.dk>
X\&      CC: =?ISO-8859-1?Q?Andr=E9_?= Pirard <PIRARD at vm1.ulg.ac.be>
X\&      Subject: =?ISO-8859-1?B?SWYgeW91IGNhbiByZWFkIHRoaXMgeW8=?=
X\&       =?ISO-8859-2?B?dSB1bmRlcnN0YW5kIHRoZSBleGFtcGxlLg==?=
X\&       =?US-ASCII?Q?.._cool!?=
X.Ve
X.PP
XThe fields basically decode to (sorry, I can only approximate the
XLatin characters with 7 bit sequences /o and 'e):
X.PP
X.Vb 4
X\&      From: Keith Moore <moore at cs.utk.edu>
X\&      To: Keld J/orn Simonsen <keld at dkuug.dk>
X\&      CC: Andr'e  Pirard <PIRARD at vm1.ulg.ac.be>
X\&      Subject: If you can read this you understand the example... cool!
X.Ve
X.PP
X\&\fBSupplement\fR: Fellow Americans, Europeans, you probably won't know
Xwhat the hell this module is for.  East Asians, et al, you probably do.
X\&\f(CW\*(C`:\-)\*(C'\fR.
X.PP
XFor example, here's a valid \s-1MIME\s0 header you might get:
X.PP
X.Vb 2
X\&      Subject: =?EUC-KR?B?sNTAuLinKGxhemluZXNzKSwgwvzB9ri7seIoaW1w?=
X\&       =?EUC-KR?B?YXRpZW5jZSksILGzuLgoaHVicmlzKQ==?=
X.Ve
X.PP
XThe fields basically decode to (sorry, I cannot approximate the
Xnon-Latin multibyte characters with any 7 bit sequences):
X.PP
X.Vb 1
X\&      Subject: ???(laziness), ????(impatience), ??(hubris)
X.Ve
X.SH "PUBLIC INTERFACE"
X.IX Header "PUBLIC INTERFACE"
X.IP "decode_mimewords \s-1ENCODED\s0, [\s-1OPTS\s0...]" 4
X.IX Item "decode_mimewords ENCODED, [OPTS...]"
X\&\fIFunction.\fR
XGo through the string looking for RFC\-1522\-style \*(L"Q\*(R"
X(quoted\-printable, sort of) or \*(L"B\*(R" (base64) encoding, and 
decode them.
X.Sp
X\&\fBIn an array context,\fR splits the \s-1ENCODED\s0 string into a 
list of decoded
X\&\f(CW\*(C`[DATA, CHARSET]\*(C'\fR pairs, and returns that list. 
Unencoded
Xdata are returned in a 1\-element array \f(CW\*(C`[DATA]\*(C'\fR, 
giving an effective
X\&\s-1CHARSET\s0 of \f(CW\*(C`undef\*(C'\fR.
X.Sp
X.Vb 4
X\&    $enc = '=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld at dkuug.dk>';
X\&    foreach (decode_mimewords($enc)) {
X\&        print "", ($_[1] || 'US-ASCII'), ": ", $_[0], "\en";
X\&    }
X.Ve
X.Sp
X\&\fBIn a scalar context,\fR joins the \*(L"data\*(R" elements of the above
Xlist together, and returns that.  \fIWarning: this is 
information\-lossy,\fR
Xand probably \fInot\fR what you want, but if you know that all charsets
Xin the \s-1ENCODED\s0 string are identical, it might be useful to you.
X(Before you use this, please see \*(L"unmime\*(R" in MIME::WordDecoder,
Xwhich is probably what you want.)
X\&\fBNote\fR: See also \*(L"Charset\*(R" option below.
X.Sp
XIn the event of a syntax error, $@ will be set to a description
Xof the error, but parsing will continue as best as possible (so as to
Xget \fIsomething\fR back when decoding headers).
X$@ will be false if no error was detected.
X.Sp
XAny arguments past the \s-1ENCODED\s0 string are taken to define a hash 
of options:
X.RS 4
X.IP "Charset" 4
X.IX Item "Charset"
X\&\fBImprovement by this module\fR:
XName of character set by which data elements in scalar context
Xwill be converted.
XIf this option is specified as special value \f(CW"_UNICODE_"\fR,
Xreturned value will be Unicode string.
X.Sp
XWhen Unicode/multibyte support is disabled
X(see \*(L"\s-1USE_ENCODE\s0\*(R" in MIME::Charset),
Xthis option will not have any effects.
X.Sp
X\&\fBNote\fR:
XThis feature is still information\-lossy, \fIexcept\fR when 
\f(CW"_UNICODE_"\fR is
Xspecified.
X.IP "Field" 4
X.IX Item "Field"
XName of the mail field this string came from.  \fICurrently ignored.\fR
X.RE
X.RS 4
X.Sp
X\&\fBImprovement by this module\fR:
XAdjacent encoded-words with same charset will be concatenated
Xto handle multibyte sequences safely.
X.Sp
X\&\fBChange by this module\fR:
XMalformed base64 encoded-words will be kept encoded.
XIn this case $@ will be set.
X.Sp
X\&\fBCompatibility with MIME::Words\fR:
XWhitespaces surrounding unencoded data will not be stripped.
X.RE
X.IP "encode_mimeword \s-1RAW\s0, [\s-1ENCODING\s0], [\s-1CHARSET\s0]" 4
X.IX Item "encode_mimeword RAW, [ENCODING], [CHARSET]"
X\&\fIFunction.\fR
XEncode a single \s-1RAW\s0 \*(L"word\*(R" that has unsafe characters.
XThe \*(L"word\*(R" will be encoded in its entirety.
X.Sp
X.Vb 2
X\&    ### Encode "<<Franc,ois>>":
X\&    $encoded = encode_mimeword("\exABFran\exE7ois\exBB");
X.Ve
X.Sp
XYou may specify the \s-1ENCODING\s0 (\f(CW"Q"\fR or \f(CW"B"\fR), which 
defaults to \f(CW"Q"\fR.
X\&\fBImprovement by this module\fR:
XYou may also specify it as ``special'' value: \f(CW"S"\fR to choose shorter
Xone of either \f(CW"Q"\fR or \f(CW"B"\fR.
X.Sp
XYou may specify the \s-1CHARSET\s0, which defaults to 
\f(CW\*(C`iso\-8859\-1\*(C'\fR.
X.Sp
X\&\fBChange by this module\fR:
XSpaces will be escaped with ``_'' by \f(CW"Q"\fR encoding.
X.IP "encode_mimewords \s-1RAW\s0, [\s-1OPTS\s0]" 4
X.IX Item "encode_mimewords RAW, [OPTS]"
X\&\fIFunction.\fR
XGiven a \s-1RAW\s0 string, try to find and encode all \*(L"unsafe\*(R" 
sequences
Xof characters:
X.Sp
X.Vb 2
X\&    ### Encode a string with some unsafe "words":
X\&    $encoded = encode_mimewords("Me and \exABFran\exE7ois\exBB");
X.Ve
X.Sp
XReturns the encoded string.
X.Sp
X\&\fBImprovement by this module\fR:
X\&\s-1RAW\s0 may be a Unicode string when Unicode/multibyte support is 
enabled
X(see \*(L"\s-1USE_ENCODE\s0\*(R" in MIME::Charset).
XFurthermore, \s-1RAW\s0 may be a reference to that returned
Xby \*(L"decode_mimewords\*(R" on array context.  In latter case 
\*(L"Charset\*(R"
Xoption (see below) will be overridden (see also notes below).
X.Sp
XAny arguments past the \s-1RAW\s0 string are taken to define a hash of 
options:
X.RS 4
X.IP "Charset" 4
X.IX Item "Charset"
XEncode all unsafe stuff with this charset.  Default is 
'\s-1ISO\-8859\-1\s0',
Xa.k.a. \*(L"Latin\-1\*(R".
X.IP "Detect7bit" 4
X.IX Item "Detect7bit"
X\&\fBImprovement by this modlue\fR:
XWhen \*(L"Encoding\*(R" option (see below) is specified as \f(CW"a"\fR 
and \*(L"Charset\*(R"
Xoption is unknown, try to detect 7\-bit charset on given \s-1RAW\s0 string.
XDefault is \f(CW"YES"\fR.
XWhen Unicode/multibyte support is disabled,
Xthis option will not have any effects
X(see \*(L"\s-1USE_ENCODE\s0\*(R" in MIME::Charset).
X.IP "Encoding" 4
X.IX Item "Encoding"
XThe encoding to use, \f(CW"q"\fR or \f(CW"b"\fR.  The default is 
\f(CW"q"\fR.
X\&\fBImprovement by this module\fR:
XYou may also specify ``special'' values: \f(CW"a"\fR will automatically 
choose
Xrecommended encoding to use (with charset conversion if alternative
Xcharset is recommended: see MIME::Charset);
X\&\f(CW"s"\fR will choose shorter one of either \f(CW"q"\fR or \f(CW"b"\fR.
X.IP "Field" 4
X.IX Item "Field"
XName of the mail field this string will be used in.
X\&\fBImprovement by this module\fR:
XLength of mail field name will be considered in the first line of
Xencoded header.
X.IP "Minimal" 4
X.IX Item "Minimal"
X\&\fBImprovement by this module\fR:
XTakes care of natural word separators (i.e. whitespaces)
Xin the text to be encoded.
XIf \f(CW"NO"\fR is specified, this module will encode whole text
X(if encoding needed) not regarding whitespaces;
Xencoded-words exceeding line length will be splitted based only on their
Xlengths.
XDefault is \f(CW"YES"\fR.
X.Sp
X\&\fBNote\fR:
XAs of release 0.040, default has been changed to \f(CW"YES"\fR to ensure
Xcompatibility with MIME::Words.
XOn earlier releases, this option was fixed to be \f(CW"NO"\fR.
X.RE
X.RS 4
X.Sp
X\&\fBNotes on improvement by this module\fR:
XWhen \s-1RAW\s0 is an arrayref,
Xadjacent encoded-words are concatenated.  Then they are splitted taking
Xcare of character boundaries of multibyte sequences, when Unicode/multibyte
Xsupport is enabled.
XPortions for unencoded data should include surrounding whitespace(s), or
Xthey will be merged into adjoining encoded word(s).
X.RE
X.SH "VERSION"
X.IX Header "VERSION"
XConsult \f(CW$VERSION\fR variable.
X.PP
XDevelopment versions of this module may be found at
X<http://hatuka.nezumi.nu/repos/MIME\-EncWords/>.
X.SH "SEE ALSO"
X.IX Header "SEE ALSO"
XMIME::Charset,
XMIME::Tools
X.SH "AUTHORS"
X.IX Header "AUTHORS"
XThe original version of function \fIdecode_mimewords()\fR is derived from
XMIME::Words module that was written by:
X    Eryq (\fIeryq at zeegee.com\fR), ZeeGee Software Inc 
(\fIhttp://www.zeegee.com\fR).
X    David F. Skoll (dfs at roaringpenguin.com) http://www.roaringpenguin.com
X.PP
XOther stuff are rewritten or added by:
X    Hatuka*nezumi \- \s-1IKEDA\s0 Soji <hatuka(at)nezumi.nu>.
X.PP
XAll rights reserved.  This program is free software; you can redistribute
Xit and/or modify it under the same terms as Perl itself.
END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/blib/man3/MIME::EncWords.3
echo x - p5-MIME-EncWords/work/MIME-EncWords-0.040/pm_to_blib
sed 's/^X//' >p5-MIME-EncWords/work/MIME-EncWords-0.040/pm_to_blib << 
'END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/pm_to_blib'
END-of-p5-MIME-EncWords/work/MIME-EncWords-0.040/pm_to_blib
echo x - 
p5-MIME-EncWords/work/.extract_done.MIME-EncWords._var_tmp_MIME-EncWords
sed 's/^X//' 
 >p5-MIME-EncWords/work/.extract_done.MIME-EncWords._var_tmp_MIME-EncWords 
<< 
'END-of-p5-MIME-EncWords/work/.extract_done.MIME-EncWords._var_tmp_MIME-EncWords'
END-of-p5-MIME-EncWords/work/.extract_done.MIME-EncWords._var_tmp_MIME-EncWords
echo x - 
p5-MIME-EncWords/work/.patch_done.MIME-EncWords._var_tmp_MIME-EncWords
sed 's/^X//' 
 >p5-MIME-EncWords/work/.patch_done.MIME-EncWords._var_tmp_MIME-EncWords 
<< 
'END-of-p5-MIME-EncWords/work/.patch_done.MIME-EncWords._var_tmp_MIME-EncWords'
END-of-p5-MIME-EncWords/work/.patch_done.MIME-EncWords._var_tmp_MIME-EncWords
echo x - 
p5-MIME-EncWords/work/.configure_done.MIME-EncWords._var_tmp_MIME-EncWords
sed 's/^X//' 
 >p5-MIME-EncWords/work/.configure_done.MIME-EncWords._var_tmp_MIME-EncWords 
<< 
'END-of-p5-MIME-EncWords/work/.configure_done.MIME-EncWords._var_tmp_MIME-EncWords'
END-of-p5-MIME-EncWords/work/.configure_done.MIME-EncWords._var_tmp_MIME-EncWords
echo x - 
p5-MIME-EncWords/work/.build_done.MIME-EncWords._var_tmp_MIME-EncWords
sed 's/^X//' 
 >p5-MIME-EncWords/work/.build_done.MIME-EncWords._var_tmp_MIME-EncWords 
<< 
'END-of-p5-MIME-EncWords/work/.build_done.MIME-EncWords._var_tmp_MIME-EncWords'
END-of-p5-MIME-EncWords/work/.build_done.MIME-EncWords._var_tmp_MIME-EncWords
echo x - p5-MIME-EncWords/work/.PLIST.mktmp
sed 's/^X//' >p5-MIME-EncWords/work/.PLIST.mktmp << 
'END-of-p5-MIME-EncWords/work/.PLIST.mktmp'
Xlib/perl5/5.8.8/man/man3/MIME::EncWords.3.gz
X at unexec rm -f %D/lib/perl5/5.8.8/man/cat3/MIME::EncWords.3.gz 
%D/lib/perl5/5.8.8/man/cat3/MIME::EncWords.3 
%D/lib/perl5/5.8.8/man/cat3/MIME::EncWords.3.gz 
%D/lib/perl5/5.8.8/man/cat3/MIME::EncWords.3.gz.gz 
%D/lib/perl5/5.8.8/man/cat3/MIME::EncWords.3.gz.bz2
X at unexec rmdir %D 2> /dev/null || true
END-of-p5-MIME-EncWords/work/.PLIST.mktmp
echo x - p5-MIME-EncWords/work/.PLIST.flattened
sed 's/^X//' >p5-MIME-EncWords/work/.PLIST.flattened << 
'END-of-p5-MIME-EncWords/work/.PLIST.flattened'
X/var/tmp/MIME-EncWords/lib/perl5/5.8.8/man/man3/MIME::EncWords.3.gz
END-of-p5-MIME-EncWords/work/.PLIST.flattened
echo x - p5-MIME-EncWords/work/.PLIST.setuid
sed 's/^X//' >p5-MIME-EncWords/work/.PLIST.setuid << 
'END-of-p5-MIME-EncWords/work/.PLIST.setuid'
END-of-p5-MIME-EncWords/work/.PLIST.setuid
echo x - p5-MIME-EncWords/work/.PLIST.writable
sed 's/^X//' >p5-MIME-EncWords/work/.PLIST.writable << 
'END-of-p5-MIME-EncWords/work/.PLIST.writable'
END-of-p5-MIME-EncWords/work/.PLIST.writable
echo x - p5-MIME-EncWords/work/.PLIST.objdump
sed 's/^X//' >p5-MIME-EncWords/work/.PLIST.objdump << 
'END-of-p5-MIME-EncWords/work/.PLIST.objdump'
END-of-p5-MIME-EncWords/work/.PLIST.objdump
echo x - 
p5-MIME-EncWords/work/.install_done.MIME-EncWords._var_tmp_MIME-EncWords
sed 's/^X//' 
 >p5-MIME-EncWords/work/.install_done.MIME-EncWords._var_tmp_MIME-EncWords 
<< 
'END-of-p5-MIME-EncWords/work/.install_done.MIME-EncWords._var_tmp_MIME-EncWords'
END-of-p5-MIME-EncWords/work/.install_done.MIME-EncWords._var_tmp_MIME-EncWords
echo x - p5-MIME-EncWords/pkg-plist
sed 's/^X//' >p5-MIME-EncWords/pkg-plist << 
'END-of-p5-MIME-EncWords/pkg-plist'
X%%SITE_PERL%%/%%PERL_ARCH%%/auto/MIME/EncWords/.packlist
X%%SITE_PERL%%/MIME/EncWords.pm
X at dirrm %%SITE_PERL%%/%%PERL_ARCH%%/auto/MIME/EncWords
X at dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/MIME
X at dirrmtry %%SITE_PERL%%/MIME
END-of-p5-MIME-EncWords/pkg-plist
exit
--- p5-MIME-EncWords.shar ends here ---


.

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list