You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Michael <mi...@michael.lai.name> on 2003/10/22 06:32:16 UTC

[users@httpd] big5 charset not displayed automatically

Hi.  I am running apache 2.0.47 on redhat 9.  In my website, I have a
page with chinese characters.  The page contains the meta tag:

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

which is suppose to instruct the client to automatically use big5
encoding but the characters still come out funny.  I have to manually
go to View->Encoding and select Big5 to see characters properly.

So, I started to think that the problem probably lies with my
webserver and searching around the web, I found that others who
switched from apache 1.3 to apache 2.0 also has the same problem.  I
went to my httpd.conf and edited the AddDefaultCharset to:

AddDefaultCharset Big5

I restarted apache and the chinese text is displayed properly.  But now the
english characters in the english only webpages have lost the style of the
its font even though I have specified the charset to be "iso-8859-1" in the
meta tag.  Not sure how to describe it but the english characters comes out
bigger with sharper corners like it is written by a child.  If I re-edit
httpd.conf and change AddDefaultCharset back to "iso-8859-1" then the
English characters retain the smoothness of its font style but again the
chinese characters doesn't show without manually selecting the proper
encoding in the browser.

Is there a way to show both english and chinese characters without losing
the english font style?

Thanks for any help in advance.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] big5 charset not displayed automatically

Posted by Jonas Eckerman <jo...@frukt.org>.
On Wed, 22 Oct 2003 22:22:08 +0800 (HKT), Michael wrote:

> And this happens on many IE browsers that I tested.

Only on IE?

> tested.  This led me to think that the webserver has some control
> over the encoding of a webpage.

Have you checked what http headers you get from the server? It's 
pretty easy to do with wget -s, Mozilla Firebord with Live HTTP 
Headers or just plain old telnet.

The server does have control over the HTTP headers (of course).

Maybe you could use mod_asis or mod_headers in solving this:
http://httpd.apache.org/docs-2.0/mod/mod_asis.html
http://httpd.apache.org/docs-2.0/mod/mod_headers.html

Regards
/Jonas
-- 
Jonas Eckerman, jonas_lists@frukt.org
http://www.fsdb.org/



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] big5 charset not displayed automatically

Posted by Michael <mi...@michael.lai.name>.
Thanks for your response, Peter.  Please note my responses below.

> I think you may find this is not a server problem.
> I did have a charset problem. The wrong characters
> were displayed (like before you specified Big5).
>
> What you are complaining about, with childish
> characters, sounds more like a representation/display
> problem. That's the job of your browser.

You know, I used to think similarly until now.  The meta tag is suppose to
tell the client which encoding to use but no matter what I do in the meta
tag it doesn't affect the encoding in the browser.  Not until I change the
AddDefaultCharset directive.  And this happens on many IE browsers that I
tested.  This led me to think that the webserver has some control over the
encoding of a webpage.

> Is there a problem with the way fonts are specified
> in the html? The browser could be using a default font
> because it cannot understand the font spec. after the
> charset change - for some crazy reason.

I don't think it is a problem with the default fonts.  You will find that
using Big5 encoding, all english characters will lose its font style.

> It is true that Apache 2 has become strict over
> charset specs. Version 1.3 was "sloppier".
>
> Peter

Michael.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] big5 charset not displayed automatically

Posted by Michael <mi...@michael.lai.name>.
I specified the charset in the Directory directive and that seemed to do the
trick.  Ryan was right about Netscape though.  I noticed that it obeys the
charset specified in the meta tag while IE completely ignors it.

Thanks for everyone's help.

Michael.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] big5 charset not displayed automatically

Posted by Ryan Snow <sn...@straightlinephobia.com>.
META tags with an HTTP-EQUIV attribute are equivalent to HTTP headers.
Typically, they control the action of browsers, and may be used to refine
the information provided by the actual headers. Tags using this form should
have an equivalent effect when specified as an HTTP header, and in some
servers may be translated to actual HTTP headers automatically or by a
pre-processing tool.
Note: While HTTP-EQUIV META tag appears to work properly with Netscape
Navigator, other browsers may ignore them, and they are ignored by Web
proxies, which are becoming more widespread. Use of the equivalent HTTP
header, as supported by e.g. Apache server, is more reliable and is
recommended wherever possible.



----- Original Message -----
From: "Michael" <mi...@michael.lai.name>
To: <us...@httpd.apache.org>
Sent: Wednesday, October 22, 2003 10:26 AM
Subject: Re: [users@httpd] big5 charset not displayed automatically


> > The reason you are getting the differently styled english font is it is
> > actually the big5 font in english.
>
> Even if it is an english only page with the charset set to iso-8859-1?
>
> > I suggest you setup some directives to control the language.
> >
> > You can also do it on a per directory bases
> >
> > <Directory /chinese/>
> > <Files *.html>
> > DefaultLanguage big5
> > </Files>
> > </Directory>
> >
> > Hope this helps
> >
> > Ryan Snow
>
> Thanks, I will give that a try although it seems like a rather odd way of
> controlling the encoding.  What is the use of the meta tag then?
>
> Michael.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] big5 charset not displayed automatically

Posted by Michael <mi...@michael.lai.name>.
> The reason you are getting the differently styled english font is it is
> actually the big5 font in english.

Even if it is an english only page with the charset set to iso-8859-1?

> I suggest you setup some directives to control the language.
>
> You can also do it on a per directory bases
>
> <Directory /chinese/>
> <Files *.html>
> DefaultLanguage big5
> </Files>
> </Directory>
>
> Hope this helps
>
> Ryan Snow

Thanks, I will give that a try although it seems like a rather odd way of
controlling the encoding.  What is the use of the meta tag then?

Michael.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] big5 charset not displayed automatically

Posted by Ryan Snow <sn...@straightlinephobia.com>.
The reason you are getting the differently styled english font is it is
actually the big5 font in english. I suggest you setup some directives to
control the language.

For example, the follow will set language types based on file extensions

AddLanguage en .en .english
AddLanguage big5 .ch .chinese

you can also use the DefaultLanguage directive for files that do not have an
extension defined by an AddLanguage directive.

You can also do it on a per directory bases

<Directory /chinese/>
<Files *.html>
DefaultLanguage big5
</Files>
</Directory>

Hope this helps

Ryan Snow
----- Original Message -----
From: "Peter Bissmire" <pb...@onetel.net.uk>
To: <us...@httpd.apache.org>
Sent: Wednesday, October 22, 2003 1:37 AM
Subject: Re: [users@httpd] big5 charset not displayed automatically


> Hi Michael,
>
> I think you may find this is not a server problem.
> I did have a charset problem. The wrong characters
> were displayed (like before you specified Big5).
>
> What you are complaining about, with childish
> characters, sounds more like a representation/display
> problem. That's the job of your browser.
>
> Is there a problem with the way fonts are specified
> in the html? The browser could be using a default font
> because it cannot understand the font spec. after the
> charset change - for some crazy reason.
>
> It is true that Apache 2 has become strict over
> charset specs. Version 1.3 was "sloppier".
>
> Peter
>
>
> Michael wrote:
>
> > Hi.  I am running apache 2.0.47 on redhat 9.  In my website, I have a
> > page with chinese characters.  The page contains the meta tag:
> >
> > <meta http-equiv="Content-Type" content="text/html; charset=big5">
> >
> > which is suppose to instruct the client to automatically use big5
> > encoding but the characters still come out funny.  I have to manually
> > go to View->Encoding and select Big5 to see characters properly.
> >
> > So, I started to think that the problem probably lies with my
> > webserver and searching around the web, I found that others who
> > switched from apache 1.3 to apache 2.0 also has the same problem.  I
> > went to my httpd.conf and edited the AddDefaultCharset to:
> >
> > AddDefaultCharset Big5
> >
> > I restarted apache and the chinese text is displayed properly.  But now
the
> > english characters in the english only webpages have lost the style of
the
> > its font even though I have specified the charset to be "iso-8859-1" in
the
> > meta tag.  Not sure how to describe it but the english characters comes
out
> > bigger with sharper corners like it is written by a child.  If I re-edit
> > httpd.conf and change AddDefaultCharset back to "iso-8859-1" then the
> > English characters retain the smoothness of its font style but again the
> > chinese characters doesn't show without manually selecting the proper
> > encoding in the browser.
> >
> > Is there a way to show both english and chinese characters without
losing
> > the english font style?
> >
> > Thanks for any help in advance.
> >
> > ---------------------------------------------------------------------
> > The official User-To-User support forum of the Apache HTTP Server
Project.
> > See <URL:http://httpd.apache.org/userslist.html> for more info.
> > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> > For additional commands, e-mail: users-help@httpd.apache.org
>


----------------------------------------------------------------------------
----


> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] big5 charset not displayed automatically

Posted by Peter Bissmire <pb...@onetel.net.uk>.
Hi Michael,

I think you may find this is not a server problem.
I did have a charset problem. The wrong characters
were displayed (like before you specified Big5).

What you are complaining about, with childish
characters, sounds more like a representation/display
problem. That's the job of your browser.

Is there a problem with the way fonts are specified
in the html? The browser could be using a default font
because it cannot understand the font spec. after the
charset change - for some crazy reason.

It is true that Apache 2 has become strict over
charset specs. Version 1.3 was "sloppier".

Peter


Michael wrote:

> Hi.  I am running apache 2.0.47 on redhat 9.  In my website, I have a
> page with chinese characters.  The page contains the meta tag:
>
> <meta http-equiv="Content-Type" content="text/html; charset=big5">
>
> which is suppose to instruct the client to automatically use big5
> encoding but the characters still come out funny.  I have to manually
> go to View->Encoding and select Big5 to see characters properly.
>
> So, I started to think that the problem probably lies with my
> webserver and searching around the web, I found that others who
> switched from apache 1.3 to apache 2.0 also has the same problem.  I
> went to my httpd.conf and edited the AddDefaultCharset to:
>
> AddDefaultCharset Big5
>
> I restarted apache and the chinese text is displayed properly.  But now the
> english characters in the english only webpages have lost the style of the
> its font even though I have specified the charset to be "iso-8859-1" in the
> meta tag.  Not sure how to describe it but the english characters comes out
> bigger with sharper corners like it is written by a child.  If I re-edit
> httpd.conf and change AddDefaultCharset back to "iso-8859-1" then the
> English characters retain the smoothness of its font style but again the
> chinese characters doesn't show without manually selecting the proper
> encoding in the browser.
>
> Is there a way to show both english and chinese characters without losing
> the english font style?
>
> Thanks for any help in advance.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org