问题
A strange thing happening to my system, My JavaScript files are getting corrupted automatically. like this:
�������������������������������������
I have never touched the file which are getting corrupted.
if I replace corrupted file with backup then again any other file get corrupted, This strange thing is happening in my whole localhost. I am sure it is not happaning due to any virus, I have tested my whole localhost files by many antivirus.
Is browser is doing this ?, cause which files are corrupting, they are only accessed by browser.
please help me.
回答1:
Often these issues can be due to encoding. If your JS files are saved in a different encoding than your web browser is expecting, then you see the strange question marks.
Joel has a great post about encoding on his blog and although it's kind of long I do suggest you read it to get a better understanding of encoding and how it works, if you are not already familiar with it.
By the way, UTF-8 is the most popular encoding on the internet for a reason! Check it out.
http://www.joelonsoftware.com/articles/Unicode.html
来源:https://stackoverflow.com/questions/17772910/javascript-files-getting-corrupted-automatically