NYCPHP Meetup

NYPHP.org

[nycphp-talk] [OT] Asian Font Display Issue in Firefox Web Browser

Carlos A Hoyos cahoyos at us.ibm.com
Sun Jan 20 18:40:09 EST 2008


> Certain web pages and/or web sites will display all or some Asian
characters
> instead of Western English in my on screen, inside the browser display
only.
> View source shows that the actual HTML web page, of course, does
> contain regular
> Western English characters.

Your browser is interpreting your page in a different encoding than the one
it was written / transmitted in.

There are 3 ways how the browser knows what encoding to use:

The first one (takes precedence) is any encoding that was sent in the http
headers. These headers are sent by your web server..
If there's no encoding info in the headers, the browser will look for a
"content-type" in the html meta data (head) section.
Finally, if neither one is present, the browser will try to guess the
encoding based on certain character frequencies, or use the default used in
the preferences.

My guess is your server is sending in the headers a different encoding than
the one used to create your page.

If using apache, look in the httpd.conf file for addcharset and
defaultcharset. You can also examine the headers in FF using a tool like
livehttpheaders.

If this is only happening in FF3, it might be a bug for that specific
browser. Your best bet to fix this is to make sure your web server is
sending the correct encoding.
You can do this by tweaking your httpd.conf or .htaccess file in apache, or
in php sending a header request like this:

header('Content-type: text/html; charset=ISO-8859-1);

Carlos Hoyos




More information about the talk mailing list