Forum Moderators: phranque

Message Too Old, No Replies

Forcing a charset? Need help

         

Tribe

4:21 pm on Jan 24, 2006 (gmt 0)

10+ Year Member



my pages are coded in utf-8
however, my foreign traffic uses a different setting & these settings change the page layout, text sizes & also mess up the text itself. The foreign language characters are changed to numbers & screwy looking code when not in utf8. Is there a way to code a page so that users with browser at all other settings are still viewing it in utf8. Is there a way to force their browser to view it in utf8 without changing their settings, or to change setting but put it back when they exit?

Span

4:45 pm on Jan 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Being far from an expert on this, but are you sure the problem isn't at your own server? Weird things may happen on your pages if the default server charset is "iso-8859-1" while you have "utf-8" on your pages.

Tribe

5:02 pm on Jan 24, 2006 (gmt 0)

10+ Year Member



No, it is not the server. the page is perfectly fine with utf8.. it is when user does not have this encoding selected that the page is screwed up.

Tribe

5:07 pm on Jan 24, 2006 (gmt 0)

10+ Year Member



it is wordpress, which uses by default, utf-8

this is what appears at the head;

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type');?>; charset=<?php bloginfo('charset');?>" />

the ('charset') tag is via php, displays as utf-8.
But when user has their browser set at shift-jis or euc, or any other setting period, the page gets screwed up.
This isnt a concern for users who have auto select turned on. How many do you think have it off?

LifeinAsia

5:15 pm on Jan 24, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Do you use the following tag in your HEAD section on the page?

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">

tedster

6:31 pm on Jan 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've not seen the combined <meta> tag before -- the syntax seems sounds, but it might help to split it into two separate meta tags:

<meta http-equiv="Content-Type" content="<?php bloginfo('html_type');?>;" />
<meta http-equiv="charset=<?php bloginfo('charset');?>" />

But it sounds more like a font issue than a character encoding issue -- these users may nont have the unicode characters available in the local fonts on their machine. In fact, seeing the "numbers & screwy looking code" sounds exactly like a symptom of a missing font.

Span

7:04 pm on Jan 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This isnt a concern for users who have auto select turned on. How many do you think have it off?

I would say very, very few people would change the default "auto". And you might expect that those who do, actually know what they are doing.

Tribe

7:22 pm on Jan 24, 2006 (gmt 0)

10+ Year Member



<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">

no, however, the php code in the meta writes this meta to the head via htaccess. so when viewing source you see <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
but when writing the page it is the php code