Base64 is a very common encoding method that allows you to encode any binary character into 64 characters that can be printed, so that both the picture and the Chinese text can be encoded as plain text with only ASCII. As for why to do this conversion, mainly used in the email field, the early mail gateway to identify only ASCII, if found that there are other characters in the mail will be filtered out, so that Chinese mail, there are pictures attached to the mail in these nets will have problems, So the Chinese and pictures are used base64 encoding and then transmitted, and then decoded after receiving the question of customer service. Base64 can be used in a similar situation, but can also be used as a simple encryption and so on. The following Base64 methods are described below:
The first is all the characters that may appear in the Base64:
0 A R i wuyi Z
1 B S/J 52 0
2 C T k 53 1
3 D U L 54 2
4 E V M 55 3
5 F W 56 4
6 G X o 57 5
7 H Y P 58 6
8 I Z Q 59 7
9 J/R 60 8
K-B 61 9
One L C T 62 +
M d/U 63/
N e V
F W (PAD) =
P g x
Q-H y
All characters are ' a ' ~ ' Z ', ' a ' ~ ' z ', ' 0 ' ~ ' 9 ', ' + ', '/' a total of 64, and the padding character at the end ' = '