LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Display Chinese (Big 5) by Apache V 2.0.40 (https://www.linuxquestions.org/questions/linux-software-2/display-chinese-big-5-by-apache-v-2-0-40-a-479347/)

50197433 09-01-2006 02:59 AM

Display Chinese (Big 5) by Apache V 2.0.40
 
Dear all :

I use the web server : Apache V 2.0.40
I upload a page with chinese (Big5) web page to the server. But Whenever I load the page, I read the text wrong code. I need to change the code from ISO to Chinese (Big 5) in the IE. It is annoying ! How do I need to config the server so as to display the web page with corred code ?

In fact, I have this sentence in my HTML :

<meta http-equiv="Content-Type" content="text/html; charset=big5">

So pls help !

THank a lot !!

Terry

KenJackson 09-01-2006 10:00 AM

Does your web page have a DOCTYPE tag that uses one of the strict types, like this?
Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

MSIE now uses the DOCTYPE tag as a switch. If it is one of the strict types, the browser operates in strict mode attemting to obey the standards. Otherwise, it operates in quirks mode, replicating it's old, wrong behaviour. I don't know if this is your problem, but it's worth switching to a strict tag in any case.

If you want to verify what content-type your web server is declaring the page to be, this command will show you the http header (fill in the url, of course).
Switch -S (capital S) outputs the http header.
Switch -nd avoids making directories.
Switch -O/dev/null (capital O) discards the page.
Code:

wget -S -nd -O/dev/null http://...
Also, you could post the URL here so people can look at in other browsers and other platforms.

50197433 09-02-2006 12:19 AM

Thanks your very much.

I think it is not about my broswer I use IE or Firefox / Mozilla, he problem is still exit
This is the link of my testing page : www.mte.com.hk/test.htm

CODE :

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<p><b><font face="Arial, Helvetica, sans-serif">English Testing : ABC</font></b></p>
<p><font face="Arial, Helvetica, sans-serif"><b>Chinese Testing (ocde : Big 5):
<font size="5">您好, 大家好金</font></b></font></p>
</body>
</html>

<html></html>
<html></html>

KenJackson 09-04-2006 08:08 AM

Your website is delivered with this in the http header. Since the http header is authoritative the meta tag is ignored.
Code:

  Content-Type: text/html; charset=ISO-8859-1
By default, Apache is configured to recognize files ending ".big5" as charset Big5, so here is one solution:
  • Rename test.htm to test.html.big5
  • Add this file as test.html to redirect
[HTML]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Refresh" content="0; URL=/test.html.big5"/>
</head>
<body>
</body>
</html>[/HTML]

The disadvantage to this technique is that once someone gets to the page, they are stuck. The browser 'back' button will take them to the redirect page which immediately takes them forward again. This is frustrating and irritating to your viewers.

The other (probably better) alternative it to modify /etc/httpd/conf/httpd.conf.
I'm not as confident, but it seems like you should be able to uncomment and modify this line:
#AddDefaultCharset ISO-8859-1
to this
AddDefaultCharset Big5

50197433 09-04-2006 10:19 PM

Dear KenJackson

It works !
Thank you very much !!
Terry


All times are GMT -5. The time now is 02:16 PM.