What is ASCII encoding?

ASCII (American Standard Code for Information Interchange) is a character encoding standard for electronic communication. It defines a set of characters, each with a unique numerical value, that can be used to represent text in computers, communication equipment, and other devices.

How does ASCII work?

The ASCII character set consists of 128 characters, including the uppercase and lowercase letters of the English alphabet, the digits 0 through 9, punctuation symbols, and some special characters. ASCII characters are represented in computers and other devices using a series of bits (binary digits). For example, the ASCII code for the letter 'A' is 01000001, and the ASCII code for the digit '0' is 00110000.

ASCII characters are used to represent text in many computer systems, including email and web browsers. They are also used to represent text in other electronic communication systems, such as fax machines and teletype systems.

Example

The ASCII characters in an example email message are:

From: john.doe@example.com 
To: jane.doe@example.com
Subject: Hello

Hello Jane,

How are you doing today?

Sincerely,

John

Each character in the message, including letters, digits, punctuation marks, and special characters, is represented using a unique ASCII code. For example, the ASCII code for the letter 'A' is 01000001, and the ASCII code for the digit '0' is 00110000.

The ASCII characters in the email headers (the lines starting with "From:", "To:", and "Subject:") are used to provide information about the sender, recipient, and subject of the email message. The ASCII characters in the body of the message (the main text of the message) are used to represent the content of the message.

Base64 encoding

All email messages are transmitted using ASCII characters because email systems only support text data. However, the email message may contain data not in ASCII format, such as images or other binary data. In these cases, the non-ASCII data must be encoded using a method such as base64 encoding before it can be included in the email message.