
Repairing Damaged or Unreadable CJKV Text
|
291
Quoted-Printable transformation is dened in Ned Freed and Nathaniel Borenstein’s RFC
2045, Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message
Bodies.
*
RFCs 2047, MIME (Multipurpose Internet Mail Extensions) Part ree: Message
Header Extensions for Non-ASCII Text, and 2231, MIME Parameter Value and Encoded
Word Extensions: Character Sets, Languages, and Continuations, should also be consulted.
†
While most Quoted-Printable–transformed data is found in email message bodies, it can
sometimes be found in email message headers, such as in the following one that I received
(the emboldened portions represent the actual data; the rest is part of the transformation
process that is explained in Table 4-90):
Subject: =?Big5?Q?=A6=5E=C2=D0_=3A_Reply_=3A_Tze=2Dloi_Input_Method?=
e following short Perl program converts Quoted-Printable data back into its original
form:
while (defined($line = <STDIN>)) {
$line =~ s/=([0-9A-Fa-f][0-9A-Fa-f])/chr hex $1/ge;
$line =~ s/=[\n\r]+$//;
print STDOUT $line;
}
is and many more Perl programs are provided in Appendix C to serve as examples from
which you can write your own routines, whether in Perl or your programming language
of choice.
Base64 Transformation
Base64 transformation is more complex than Quoted-Printable in that it involves manip-
ulation of data at the bit level and ...