Chinese text not displaying properly on web page

随声附和 提交于 2019-12-12 01:24:13

问题


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:

繁體中文版

rather than in Chinese characters:

繁體中文版

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

Thanks very much for any help.


回答1:


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.

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

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

Hope this helps



来源:https://stackoverflow.com/questions/3578100/chinese-text-not-displaying-properly-on-web-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!