Continued http://www.cnblogs.com/qingjun1991/p/4971689.html
TXT file Open is garbled, that is because the software does not have the correct identification code
Sometimes you see a JPG image that moves like a gif, that's because it's just a jpg, it's actually a GIF format.
There are a lot of things like these ...
Like JPG, PNG, GIF, BMP, RAR, zip, MP3, mid ... Most of these non-text files will indicate the true format of the file in the first few bytes of the file, so just determine the first few bytes of the file.
Like TXT, HTML, CS, Java, CSS, JS, XML, CPP ... These text files can also be identified by the first few bytes, but the ANSI encoding is not added, the ANSI code will be different because of the operating system, so that the frequent occurrence of garbled.
So I developed a way of identifying and integrating it into my work.
When you open a software browse file, the format column of the file list is the result of smart encoding recognition and smart format recognition, underlining that it is a text file
If you require a high-precision text file encoding recognition, click on the Advanced button, tick the strongest identification code
OP 2: Resource Manager ex (smart code recognition and smart format recognition)