Encode::MIME::Header(3pm) Perl Programmers Reference Guide Encode::MIME::Header(3pm)NAME
Encode::MIME::Header -- MIME 'B' and 'Q' header encoding
use Encode qw/encode decode/;
$utf8 = decode('MIME-Header', $header);
$header = encode('MIME-Header', $utf8);
This module implements RFC 2047 Mime Header Encoding. There are 3 variant encoding names; "MIME-Header", "MIME-B" and "MIME-Q". The
difference is described below
MIME-Header Both B and Q =?UTF-8?B?....?=
MIME-B B only; Q croaks =?UTF-8?B?....?=
MIME-Q Q only; B croaks =?UTF-8?Q?....?=
When you decode(=?encoding?X?ENCODED WORD?=), ENCODED WORD is extracted and decoded for X encoding (B for Base64, Q for Quoted-Printable).
Then the decoded chunk is fed to decode(encoding). So long as encoding is supported by Encode, any source encoding is fine.
When you encode, it just encodes UTF-8 string with X encoding then quoted with =?UTF-8?X?....?= . The parts that RFC 2047 forbids to
encode are left as is and long lines are folded within 76 bytes per line.
It would be nice to support encoding to non-UTF8, such as =?ISO-2022-JP? and =?ISO-8859-1?= but that makes the implementation too
complicated. These days major mail agents all support =?UTF-8? so I think it is just good enough.
Due to popular demand, 'MIME-Header-ISO_2022_JP' was introduced by Makamaka. Thre are still too many MUAs especially cellular phone
handsets which does not grok UTF-8.
RFC 2047, <http://www.faqs.org/rfcs/rfc2047.html> and many other locations.
perl v5.16.2 2012-10-11 Encode::MIME::Header(3pm)
Check Out this Related Man Page
MIME::QuotedPrint(3pm) Perl Programmers Reference Guide MIME::QuotedPrint(3pm)NAME
MIME::QuotedPrint - Encoding and decoding of quoted-printable strings
$encoded = encode_qp($decoded);
$decoded = decode_qp($encoded);
This module provides functions to encode and decode strings into the Quoted-Printable encoding specified in RFC 2045 - MIME (Multipurpose
Internet Mail Extensions). The Quoted-Printable encoding is intended to represent data that largely consists of bytes that correspond to
printable characters in the ASCII character set. Non-printable characters (as defined by english americans) are represented by a triplet
consisting of the character "=" followed by two hexadecimal digits.
The following functions are provided:
This function will return an encoded version of the string given as argument.
Note that encode_qp() does not change newlines "
" to the CRLF sequence even though this might be considered the right thing to do
(RFC 2045 (Q-P Rule #4)).
This function will return the plain text version of the string given as argument.
If you prefer not to import these routines into your namespace you can call them as:
use MIME::QuotedPrint ();
$encoded = MIME::QuotedPrint::encode($decoded);
$decoded = MIME::QuotedPrint::decode($encoded);
Copyright 1995-1997 Gisle Aas.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.8.0 2002-06-01 MIME::QuotedPrint(3pm)
I am new to ksh scripting so your help will be much appreciated.
I have a file called file.txt which looks like this
Header 20050702 20050703
Header 20050703 20050704
Header 20050704 20050705
What I am trying to do is write out each of the record... (7 Replies)
I need to add a header of one line to an already existing file.
I know that it can be achieved by the following:
echo "Header" > newfile
cat file1 >> newfile
But my problem is that file is huge and there is no space for creating a new file every time. Is there a way that I can... (5 Replies)
I dont know if this is a dumb question, but I am unable to move ahead and need help -
There is a perl module called Header.pm which was written by someone else. I am trying to write a simple perl script which uses a function provided by the module. The function has been exported by the module... (9 Replies)
I have spaces in between file names.
And how can I remove spaces between file names like below
Srimitta (10 Replies)
I am having a file in below stucture:
field1 : value
field2 : value
} //end of subheader1
field4 : value
field5 : value
subheader4 (6 Replies)
I am karthik. I am new to this forum. I have one requirement.
I have a file with header and footer.
Header may be like
(Assume it is unknown so far, but i am sure there is a header in the file)
likewise file has the trailer too.
I just... (7 Replies)
I have a requirement to create a Header &Trailer for a file which is having 20 millions of records.
If I use the following method, i think it will take more time.
cat "Header"> file1.txt
since second CAT command has to read all... (4 Replies)
I am beginner to Unix.
My requirement is to validate the encoding used in the incoming file(csv,txt).If it is encoded with UTF-8 format,then the file should remain as such otherwise i need to chnage the encoding to UTF-8.
Please advice me how to proceed on this. (7 Replies)
I have got a requirement.
I have a source file, EMPFULL.txt and I need to split the data for every 30 records
and place a Typical Header as below with system and page number too.
2012.01.03 Employee Dept Report 1... (6 Replies)
Good Day. I would like to solve the following issue and got some strange results, if anyone could help me in this regard, you are most welcome.
Here is the problem:
I have a file like
Header Value1 Value2 Value3 Value4 Value5 Value6 ... Value9
12.144 6 5 ... (8 Replies)
My UNIX system is SUN Solaris.
I am trying to do a simple thing as described below.
I have a PIPE delimited file that has header and trailer. So the file is something like below:
Test1.txt looks like something below:
field_data1|field_data2|and some more data --Header
... (5 Replies)
I have a pipe separated file with two major lines. One is header and another is detail line. Header starts with H and Detail start with D.
D|123456|Joes... (13 Replies)