问号而不是汉字 [英] Question Marks Instead of Chinese Characters
问题描述
我想在网站上放置一些中文文本,但是一旦网页放在网上,而不是中文文本,我会看到一排问号。
I'm trying to place some Chinese text on a website, but as soon as the page is placed online, instead of Chinese text, i see a row of question marks ?????????? ???????????
我在WAMP服务器上测试了同一页面,然后将其放在网上(所有页面都有一个php扩展名)和汉字显示得很好,只有当从在线主机服务器请求页面时,我看到所有的问号。
I tested the same page on a WAMP server before putting it online (all the pages have a php extension) and the Chinese characters show just fine, it is only when the pages are requested from the online host server do i see all the question marks.
页面包含(如果有帮助):
the page contains (if this helps):
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
推荐答案
如果你使用某种数据库,请确保在查询数据库之前(但在建立连接之后)运行此操作:
If you're using a database of some sort, make sure you run this before querying the database (but after making the connection):
mysql_set_charset("utf8");
这篇关于问号而不是汉字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!