Notepad input "Unicom" two words, turn off and then open garbledThis is a very interesting thing. there is a need to mention ANSI, different countries and regions have set different standards, resulting in GB2312, BIG5, JIS and other coding standards. then, these encodings do not have a fixed format, but for example UTF-8 format is very obvious, such as the highest bit is 0,110,1110 and so on.
In the Notepad save operation, the encoding that Windows saves by default is ANSI ( GB2312in China).
In this way, the binary code of the two words is: (one word accounts for two bytes)
"Lian" ANSI encoding is 0XC1AA binary arrangement is 0 0001 10 1010;
"Tong"ANSI code is 0xcda8 binary arrangement is 0 1101 10 1000;
The coincidence lies in the fact that the ANSI encoding of the word "unicom" conforms to the second template of UTF8 encoding (see here). the "union" of the two bytes, "Pass" the beginning of the two bytes are "110" and "10" is exactly the same as the two-byte template in the UTF8 rule is consistent, and then open Notepad again, Notepad mistakenly think this is a UTF8 encoded file ( this is the reason ), let us take the first byte of 110 and the second byte of 10 minus, we get the "00001 101010", and then align you to the leading 0, you get "0000 0000 0110 1010", sorry, this is the Unicode 0x006a , that is, the lowercase letter "J" (with UltraEdit can see the letter J), and then the two bytes after decoding with UTF8 is 0x0368, the character is nothing, display garbled
This is the only "unicom" two words of the file can not be displayed in Notepad normal reason.
It can be thought that when the binary encoding of all characters in a document is in [C0≤aa (first byte) ≤df] [80≤bb (second byte) ≤BF], Notepad cannot confirm the encoding format of the text and is displayed in the UTF-8 format. With "Unicom" to analyze is C1 between [C0,DF], CD also in [C0,df],aa and A8 between [80,BB].
So, not just "unicom" two words caused by garbled, as long as find two words of GBK code value in [C0,DF] between the line, seemingly unicom lying also in the gun, then we force quite unicom, such as " Force is connected" Four words are still garbled. Oh, there is no son, joking. In fact, it's easy for you to find the characters that match your criteria.
Notepad input "Unicom" two words, turn off and then open garbled