The protocol for electronic mail that is still in use today was published in 1982: it is RFC 822 (in which RFC stands for "Request for Comments", a way to demonstrate the democratic nature of the Web's standards). This RFC stipulates that electronic messages are to be encoded in ASCII.
To mitigate that drawback, a new RFC published in 1996 (RFC 2045) introduced a technique that has since become an integral part of electronic mail: the MIME protocol (= "Multipurpose Internet Mail Extensions"). MIME allows for the attachment of files to e-mail messages and for dividing a message into multiple segments, each one potentially of a different type, or, if it is of type text, potentially in a different encoding. To specify the encoding of a message or a part of a message, we use two operators:
charset is the encoding of the content. Its value must appear on a list  established and regularly updated by IANA (= "Internet Assigned Numbers Authority"). In February 2004 there were 250 registered encodings, such as US-ASCII, ISO-2022-JP, EBCDIC-INT, ISO-8859-1, IBM437 (code page 437), windows-1252 (Windows code page 1252), etc.
The encoding affects only those segments of MIME type text (the subtype being plain, which indicates that the text is not enriched). The syntax is as follows:
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding specifies how to translate the coming binary (be yond 0x7f) bytes into ASCII data. This is necessary because MIME did ...