character encoding

character encoding

最近学习Vue框架,在Firefox中调试demo时,经常遇到以下告警:

The character encoding of the HTML document was not declared

最直接的后果就是中文信息乱码。由于是直接在vim中编写html文件,检查了vim默认的文件是utf-8编码:

set fileencoding

在网络上搜索了一下,HTML默认采用us-ancii编码格式,如果采用utf-8格式,需在head域明确声明:

<meta charset="UTF-8">
Comments are closed.