Enable UTF-8 encoding for JavaScript

后端 未结 11 959
悲哀的现实
悲哀的现实 2020-12-09 10:17

I don\'t know how should I titled this question but hope my friends will understand the problem and will help me :)

I want to show log message in arabic

11条回答
  •  余生分开走
    2020-12-09 10:38

    Just like any other text file, .js files have specific encodings they are saved in. This message means you are saving the .js file with a non-UTF8 encoding (probably ASCII), and so your non-ASCII characters never even make it to the disk.

    That is, the problem is not at the level of HTML or or Content-Type headers, but instead a very basic issue of how your text file is saved to disk.

    To fix this, you'll need to change the encoding that Dreamweaver saves files in. It looks like this page outlines how to do so; choose UTF8 without saving a Byte Order Mark (BOM). This Super User answer (to a somewhat-related question) even includes screenshots.

提交回复
热议问题