First, the necessity of encoding
E-mail can only transfer text information in the ASCII code (National Standard Information Exchange Code) format, the ASCII code is 7-bit code, and the non-ASCII code format is required to comply with 7-bit ASCII code, then Can be transferred by e-mail; if you do not encode, during the transfer process, due to the limit of the ASCII code 7 bits, it will only let the recruiter see a pile of messy ASCII characters. After the encoded file, it can be transferred smoothly during the transfer, and there is no danger of "being cut off". However, the acceptor must have the corresponding decoding program, restore this coded thing, to see what the information you want to transfer is.
One thing to pay attention to: Most people think that "text files do not need to be encoded", but our Chinese is the text of 8-digit code, not a standard ASCII code format, because Chinese is a password, so most The mail server has been able to handle the GB's internal code, so it is not necessary to do this coded / decoded operation, can be transferred directly. However, if you want to send Chinese email to abroad, you need this conversion to transfer, because foreign mail servers are unable to identify Chinese internal code. When there are some passwords that do not support the Chinese internal code, it will still be cut off, resulting in a document that cannot be read, and the encoded Chinese mail cannot be read. After receiving the file, the file is decoded, and there is also a Chinese. The system can see the Chinese information written.
Second, the common three coding standards
● Unix-to-unixEncoding
UuEncode and Uudecode are originally encoded and decoding programs used in UNIX systems, which later rewritten into programs that can also be performed in DOS. This is the most common way to transfer non-ASCII code, this UU encoding method is the most commonly used.
The method used is: Before sending the mail, use the uuencode.exe program to encode the original file into the ASCII code file with the UuEncode.exe program, then send the message. After receiving the email, the recipient is restored with the Uudecode.exe program.
WINDES-based similar programs are Wincode and Winzip, etc.
Wincode's use principle and uuencode and uudecode under DOS are nothingord, but it is easier to operate under Windows interface. Wincode also supports MIME, BINHEX and other coding formats, and the application range is quite wide.
The UU encoding described above is not only Chinese text. Any file you want to send includes the EXE-like binary files can be transferred according to the encoding → send → recipient recipient → decoding restore step.
● MULTIPURPOSEINTERNETMAILEXTENTIONS
UU encoding solves the problem with E-mail only the ASCII file. But this method is actually not very convenient, thereby developing a new coding standard, which is MultiPurposeInternetMaileXTentions, which is generally translated as "Multimedia Mail Transfer Mode". As the name suggests, it can transmit multimedia files to add a variety of format files in an email.
The MIME standard is now the mainstream of Internet email. It is the advantage that the object is used as a packaging, and multiple different files can be packaged together. Sender will choose the file to be transmitted, it instantly encoded at the time of transmission, the software of the recipient received is also immediate decoding restore, fully automated, very convenient. Of course, the prerequisite is that the software of both sides must have this function. Otherwise, if the sender is very convenient to send the letter, but if there is no such function, it is not possible to see it. Pile of mess. Using this method, the user does not need to know how it is encoded / decoded. Even if it is just written by words, it is the same as the package. If you want to send multimedia files, as long as you choose the action, send it, the rest is automatically complete by the email software. Due to the convenience of MIME, it is more and more email software. (We now use the email software eudora, netscapemail, internetmail, etc., so we can easily send and receive emails so easy.) MIME defines a specification or a collective.
In fact, it is not a single coding method that can meet this specification, as long as this MIME specification can be successfully transmitted. The cargo operation is metaphor. If the shipping company regulates the specification of the freight, it is 1 cubic meter size box. It does not limit the use of wooden boxes or iron boxes, as long as it is 1 cubic meter size, freight company You sent it. As for the box, you are a food or book or clothes or mixed dress, that is, a variety of format files can be sent together.
In the case of the above example, "1 cubic meter is the freight specification, that is, our MIME specification. Wooden box or iron box is a coding method, now let's see what" box type "you can choose .mime definition Two coding methods: Base64 and QP (Quote-Printable) rules are rules for 7 digits in the data, only 8 bits of data are converted to 7 bits. QP encoding applies to the text content of non-ASCII code, For example, our Chinese file. The Base64 coding rule is to re-encode the entire file into 7 bits, usually used to transmit binary files. The code can affect the file school after the encoding, MIME function, for e-mail software Can I automatically discriminate your email, which is encoded, and then automatically selects QP or Base64 to decode.
The qp encoding method is to represent one byte with two 16 credits, and then "=" in front. So we see the text after the QP encoding is usually this: = a4j = aea = a6n = a1i = a7 = da = AC0 = B1 = E7 = A9S = A7G = a1a = AB = DC = B0 = AA = B
Base64 encoded text is usually: pgquyazuoumn2qxpseepc6dnougr3lcqv70ms773t3lcqv70ms773t3ymyqa5plakaq5hptu If you use email software that support MIME standard, you can't see these messy characters during the transceiver. But if it is very unfortunate, the recipient does not have this software that supports MIME, and what he sees is the big segment above. But don't worry, you can still archive this "Tianshu" first, then use some Decode software to translate it back.
● Binhex encoding
Binhex's encoding method is often used in the MAC machine, which is less useful in the PC. The email software on the general PC, and most of the specifications of MIME are supported, rarely support BinHex format. In common email software, only EUDORA has this function, directly interprets binhex's encoding, if you receive this message encoded by BinHex, and your mail software is not eudora or other software support Binhex format . That also has to decode a program interpretation binhex. There is a shared software binhex3.exe with this feature, which can be found in many FTP sites. Under Windows, you can decode the Wincode described earlier. UU coding, MIME, and Binhex described herein can be handled. But unfortunately, for MIME, it only processes the code of Base64. If you can add QP's function, you can really rely on it.
In MIME, almost standard specification now, with a set of support for MIME software, these encoding / decoding work will be completed, and you will not bring trouble.