未声明纯文本文档的字符编码 - mootool 脚本 [英] The character encoding of the plain text document was not declared - mootool script

查看:23
本文介绍了未声明纯文本文档的字符编码 - mootool 脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚注意到当我在 FireFox 浏览器上查看我的 mootool.js 脚本时会弹出一个警告消息.

I just noticed that there is a warning message pops up when I view my mootool.js script on FireFox browser.

警告信息是

未声明纯文本文档的字符编码.文档在某些浏览器中会呈现乱码如果文档包含来自外部的字符,则配置US-ASCII 范围.文件的字符编码需要是在传输协议或文件中声明需要使用字节顺序标记为编码签名.

The character encoding of the plain text document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the file needs to be declared in the transfer protocol or file needs to use a byte order mark as an encoding signature.

这是否意味着我必须添加字符集或其他什么?但它是一个脚本!!

does that mean I have to add a Charset or something? but it is a script!!

有没有办法解决这个问题?

Is there a solution for this?

推荐答案

在您的 HTML 中,使用以下元提供编码是一个很好的做法,例如:

In your HTML it is a good pratice to provide the encoding like using the following meta like this for example:

<meta http-equiv="content-type" content="text/html; charset=utf-8" />

但是您看到的警告可能是由多个文件之一触发的.它可能不是您的 HTML 文档.它可能是 javascript 文件或 css 文件中的内容.如果您的页面由多个包含在一起的 php 文件组成,则可能只有其中 1 个文件.

But your warning that you see may be trigged by one of multiple files. it might not be your HTML document. It might be something in a javascript file or css file. if you page is made of up multiples php files included together it may be only 1 of those files.

我不认为这个错误与 mootools 有任何关系.您会在 Firefox 控制台窗口中看到此消息.不是 mootools 脚本.

I dont think this error has anything to do with mootools. you see this message in your firefox console window. not mootools script.

也许您只需要使用可让您指定正确字符编码的代码编辑器重新保存 html 页面.

maybe you simply need to re-save your html pages using a code editor that lets you specify the correct character encoding.

这篇关于未声明纯文本文档的字符编码 - mootool 脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆