We're calling on all EU-based Mozillians with iOS or iPadOS devices to help us monitor Apple’s new browser choice screens. Join the effort to hold Big Tech to account!

為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

Chinese Characters Not Rendering

  • 9 回覆
  • 7 有這個問題
  • 1 次檢視
  • 最近回覆由 wwconslt

more options

Hello,

I have a page containing simplified chinese characters. The characters render perfectly in Chrome, Safari, IE and Android. However, the chinese characters will not render in Firefox (v 17.0.1). I've tested this both on a mac and windows. Also had other users with on both macs and pcs with the same results. The page is UTF 8 encoded.

Thank you.

Hello, I have a page containing simplified chinese characters. The characters render perfectly in Chrome, Safari, IE and Android. However, the chinese characters will not render in Firefox (v 17.0.1). I've tested this both on a mac and windows. Also had other users with on both macs and pcs with the same results. The page is UTF 8 encoded. Thank you.

所有回覆 (9)

more options

Can you give the website you are seeing this on?

more options

here's the code i'm using to test. very simple. i also selected "UTF 8 with BOM when saving in BBEdit.

====
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>For Parents: Home Page</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

	<body>
 	   Simplified Chinese </br>
		世界各地的青年女性因其在全美所享有的至高声望和所提供的卓越大学。</br>
		</br>
		Traditional Chinese</br>
		世界各地的青年女性因其在全美所享有的至高聲望和所提供的卓越大學課程。</br>
	</body>
</html>

由 cor-el 於 修改

more options

Note that you seem to be missing a closing </head> tag before the <body>


A BOM doesn't matter if the server sends the file with a specific encoding.
Firefox will always use the encoding as send by the server in that case.

You can check the content type in Tools > Page Info > General and you can also use the Web Console (Web Developer > Web Console;Ctrl+Shift+K) to check the response headers.

Do you have an online link that we can check?

由 cor-el 於 修改

more options

Thanks for your reply. This is a page (php) that is not rendering on our server at work (Apache). When I tested it on my personal web host server (also Apache), it rendered fine in Firefox! Could there possibly be a setting in the httpd.conf file that causes Firefox to behave differently than other browsers when it comes to Chinese characters?

more options

If the page is a php page then try to add this header at the start of the file:

<?php header('Content-Type: text/html; charset=utf-8'); ?>
more options

Yes, you are right. It looks like our work server is sending ISO-8859-1 encoding. My personal web host server is sending UTF-8.

more options

Thanks for the php header function suggestion. That seems to have fixed the problem! I am curious though, why all other browsers handled the utf8 page without needing that header??

more options

You're welcome.

If the server sends an (in this case wrong) encoding then Firefox will always use the encoding as send by the server.
Only if the server doesn't send an encoding then will Firefox check (sniff) the content of the file to see if it needs to use an encoding that is different from the default encoding as set in Options. This may trigger a reread in case it happens further down in the file and content has already been rendered and thus will delay things. For security reason it is always best to have the server decide how to send files and make sure that all files have that same encoding (best is to use UTF-8).

more options

Thanks again. This was excellent support. My problem is fixed and I learned a lot along the way. Much appreciated!