DWQA QuestionsCategory: Development ToolPage view JS source file Chinese code
extreme_web asked 7 days ago

Read the JS file in the web page, and the Chinese display is normal (for example, alert will output the Chinese information of JS file). But when the browser looks at the source code of JS file, it will see that the Chinese in the code is all garbled
。 Although it does not affect the program running, it will be affected when reading the JS file code. How to break this? The editor used is sublime text. Do you need to create a new JS or save a JS file?
Page view JS source file Chinese code

5 Answers
soosa answered 7 days ago

When saving files, select utf8 code

Time of puff answered 7 days ago

Set the browser code, my Firefox is also garbled, God bothered, chrome is good

LuDongWei answered 7 days ago

clipboard.png
clipboard.png
How to do it
clipboard.png
clipboard.png
Download by yourself who uses who knows

dayudodo replied 7 days ago

Prettyprint is quite easy to use!

j2ue answered 7 days ago

The code of the browser must be the same as that of the file. It seems that the browser’s encoding is set to automatic,