开发者

Messed Up Characters In Javascript

开发者 https://www.devze.com 2023-03-04 20:36 出处:网络
So, I have a few files sent to me which contain a bunch of stuff like this var time=0;//ÓÎϷʱ¼ä

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

精彩评论

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

关注公众号