开发者

Messed Up Characters In Javascript

So, I have a few files sent to me which contain a bunch of stuff like this

var time=0;//ÓÎϷʱ¼ä

Obviously, the comment corresponds to something, which I'd like to read, but it's messed up and I don't know why.

1)开发者_如何学Python How do I read this

2) How do I avoid it


Find out which character encoding the file is saved in, then instruct your editor to open the file using that encoding.

If you're on a GNU/Linux box, you can get a good guess at the encoding using this command:

file -i file.js

Here's a simple page I hacked up for those who don't have access to the file command: http://lajm.eu/encoding/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜