I. Necessity of coding
E-Mail can only transmit text information in the format of ASCII code (US national standard information interchange Code). The ASCII code is a 7-bit code, non-ASCII format files need to be compiled into 7-bit ASCII code before they can be transmitted through e-mail; if not encoded, during the transfer process, the ASCII code is decomposed Due to the seven-bit restriction. After the decomposition, the recipient will only see a bunch of messy ASCII characters. Encoded files can be transmitted smoothly during the transfer process, without the risk of being intercepted. However, the recipient must have a decoding program that restores the encoded content to see what the sender wants to send.
Note one thing: Most people think that "text files do not need to be encoded", but our Chinese is an 8-bit code text, not a standard ASCII format, because Chinese characters are common characters in China, most email servers can process GB internal code files. Therefore, this encoding/decoding operation is not required and can be directly transmitted. However, if you want to send a Chinese email to a foreign country, you need to convert it to transfer it, because the foreign email server cannot identify the Chinese internal code. When a Chinese code passes through a host that does not support Chinese internal code, it will still be intercepted, resulting in dismounting the file and failing to read the coded Chinese mail, after receiving the email, the recipient decodes and restores the file. The recipient must have a Chinese system to view the written Chinese information.
Ii. Three Common encoding standards
● UU encoding (Unix-to-unixencoding)
UUEncode and uudecode were originally the encoding and decoding programs used in Unix systems, and were later rewritten into programs that can be executed in DOS. This UU encoding method is the most commonly used method for early transfer of non-ASCII files.
Before sending a mail, use the uencode.exe program to encode the original file into an ascii code file and then send the mail. After the recipient receives the mail, the uudecode.exe program is used to restore the file.
Windows-based similar programs include wincode and WinZip.
The usage of wincode is similar to that of uuencode in DOS, but it is easier to operate on Windows. In addition to Uu encoding, wincode also supports MIME, binhex, and Other encoding formats. It is widely used.
The UU code described above is not only Chinese characters. Any files you want to send, including EXE and other binary files, can be transmitted according to encoding → sending → recipient receiving → decoding and restoration steps.
● MIME standard (Multipurpose Internet Mail Extentions)
UU encoding solves the problem that e-mail can only transmit ASCII files. However, this method is not very convenient, and thus a new encoding standard has been developed. Its full name is Multipurpose Internet Mail Extentions, which is generally translated as "multimedia mail Transmission Mode ". As the name suggests, it can send multimedia files and send them together with various format files in an email.
Mime standards have become the mainstream of Internet email. The advantage is that objects can be packaged and transmitted together with different files. As long as the sender selects the file to be transmitted, it instantly encodes the file during transmission. The recipient's software also receives instant decoding and restoration, which is completely automated and convenient. Of course, the prerequisite is that the software on both sides must have such a function. Otherwise, the sender can easily send the mail. However, if the recipient's software does not have such a function, it cannot be restored, what we see is a bunch of garbled characters. In this way, you do not need to know how it is encoded/decoded. Even if it is only written in text, it can be packed and sent. If you want to send a multimedia file, you only need to select the file and then send it. The other work is automatically completed by the email software.
Thanks to the convenience of mime, more and more email software are using this method. (The most commonly used email software Eudora, netscapemail, and internetmail are mime-based, so we can send and receive emails so easily .) Mime is defined as a type, which can also be called collectively.
In fact, the encoding method that can meet this specification is not a single one, as long as it complies with this mime specification can be smoothly transmitted. Freight as a metaphor, if the freight company requires that the size of the box sent to the freight is 1 m³, it can be checked, it is not limited to use wooden boxes or iron case, as long as it is 1 m³, the freight company will serve you. There is no limit to whether you are loading food, books, clothes, or mixed dressing in the box. That is to say, files in multiple formats can be sent together.
In the above example, "the 1 m³ skew is the freight specification, that is, our mime specification. Wooden boxes or iron case are encoded. Now let's take a look at your "Box Type" options. Mime defines two encoding methods: base64 and qP (Quote-printable ). The QP rule is to convert 8-bit data into 7-bit data without repeated encoding. QP encoding is applicable to non-ASCII text, such as Chinese files. The base64 encoding rules re-encode the entire file into seven bits, which are usually used to transmit binary files. Different encoding methods will affect the size of the encoded file, while the mime-enabled e-mail software can automatically identify the encoding of your email, then it automatically uses QP or base64 for decoding.
The QP encoding method is to represent a byte in two hexadecimal values, and then add "=" to the front ". So we can see that the text after the QP encoding is usually like this: = a4j = AEA = a6n = a1i = A7 = da = ac0 = b1 = E7 = a9s = a7g = A1A = AB = Dc = b0 = AA = B
Base64 encoded text is usually: bytes. If you use an email software that supports the MIME standard, you cannot see these messy characters when sending and receiving letters. However, unfortunately, the recipient does not have the mime-supported software. What he sees is the symbol above. But don't worry. You can still archive this book first, and then use some decode software to translate it back.
● Binhex Encoding
The binhex encoding method is often used on Mac machines and is rarely used on PCs. Generally, most email software on PC also supports MIME specifications, and few support binhex format. In common email software, Eudora can directly interpret binhex encoding. If you receive an email encoded by binhex, in addition, your mail software is not Eudora or other software that supports the binhex format. You also need to decode binhex. One Shared Software binhex3.exe has this function, which can be found on many FTP sites.
In Windows, you can also use the wincode we mentioned earlier to decode it. The UU encoding, mime, and binhex described in this article can be used for processing. Unfortunately, for mime, it only processes base64 encoding. If we can add the QP function, we can rely on it to go all over the world.
Now that mime has almost become a standard specification, you can use a set of software that supports MIME to send and receive e-mails. These encoding/decoding work will be completed automatically and will not cause you any trouble.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service