Javascript files getting corrupted automatically

核能气质少年 提交于 2019-12-11 01:49:14

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!