中文文本在网页上无法正常显示 [英] Chinese text not displaying properly on web page

查看:169
本文介绍了中文文本在网页上无法正常显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我向一个主要的英文网页添加了一些中文文本,并且无法正确显示字符。我已经在元内容类型标签的编码设置为UTF-8,我复制/粘贴我从一个Word文档发送的中文。文字仍然呈现如下:

I am adding some Chinese text to a primarily English web page and am having trouble getting the characters to display properly. I've got the encoding set to UTF-8 in the meta content type tag, and I am copying/pasting the Chinese I was sent from a Word document. The text is still rendering as follows:

ÁπÅ,'î‰Π≠ÊñáÁàà

繁體中文版

而不是汉字:

繁体中文版

我确定这是一个简单的修正,如何使这一发生。

I'm sure it's an easy fix, but I'm lost as to how to make this happen.

非常感谢任何帮助。

推荐答案

只是因为元标记说编码是UTF8,并不意味着内容UTF8。我的意思是,如果你有一个文件index.html,文件本身应编码为utf8。

just because the meta tag says that the encoding is UTF8, doesn't mean that the content (file) itself is in UTF8. I mean, if you have a file index.html, the file itself should be encoded as utf8.

要更改lunix中的文件的编码,你可以使用命令

To change the encoding of a file in lunix, you can use this command

iconv --from-code=ISO-8859-1 --to-code=UTF-8 ./index.html > ./newIndex.html

但我想你正在使用windows ...我知道更改窗口中的编码是Notepad ++

but i guess that you are working with windows... and the only way i know change the encoding in windows is the Notepad++

希望这有助于

这篇关于中文文本在网页上无法正常显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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