W3C home > Mailing lists > Public > www-international@w3.org > October to December 2002

RE: Character encoding mismatch

From: Sue Davis <Sue.Davis@tentechnologies.com>
Date: Wed, 13 Nov 2002 11:21:50 -0500
Message-ID: <A35D2E6B81AF684C8A7DEB5948A79BEAE2B1@primus.tentechnologies.com>
To: <www-international@w3.org>

Hi Chris, 


In addition to the possibility of the script generating the content-type, it's also possible that the server itself is generating the content type header.  For example, if you're running IIS, launch the Internet Services Manager" and bring up the properties for the default web site.  There should be a tab for "HTTP Headers."  This will tell you if IIS is sending a content-type header for every page it serves up.  

I assume the server generated headers take precedence when there's a conflict, but can't say for sure.

Also, make sure there's not a long series of ISO-8859-1 characters, preceding the Meta tag containing the encoding information.  I ran into this once where the JavaScript was in the wrong place, and the browser guessed 8859-1 before it got to the meta tag specifying Shift-JIS.  Easy to fix once the cause was identified, but it was hard to find.


Sue

> -----Original Message-----
> From: Paul Deuter [mailto:Paul.Deuter@plumtree.com]
> Sent: Wednesday, November 13, 2002 10:35 AM
> To: Chris Phillips; www-international@w3.org
> Subject: RE: Character encoding mismatch
> 
> 
> 
> There are two ways to set the character encoding.  One is through
> the HTTP Content-type header and the other is through an HTML
> meta tag.  If you are creating a static HTML page, then you usually
> choose the second method.  If you are running a script on the 
> Web server (such as an ASP or JSP page), then you have opportunity
> to write code that will cause the Webserver to set the HTTP 
> Content-type
> header in the response.
> 
> Evidently you are runnning some kind of script and the Content-Type
> header is getting set but it is getting set to ISO-8859-1.  My guess
> is that your script is JSP or Java related because Java servlets use
> ISO-8859-1 as their default encoding.  If your page is a JSP page,
> then you will want to add code to set a property on the response
> object for GB2312.
> 
> -Paul
> 
> -----Original Message-----
> From: Chris Phillips [mailto:chris@english-partner.com]
> Sent: Wednesday, November 13, 2002 6:40 AM
> To: www-international@w3.org
> Subject: Character encoding mismatch
> 
> 
> 
> 
> I have just localised a site into Chinese (GB2312)
> 
> The thing is that when I go to the site on the net my browser 
> doesn't pick 
> up that it is GB2312 and instead keeps it as (iso-8859-1). I have to 
> manually change the encoding for the page to view properly. 
> This doesn't 
> happen when I view other sites with the same encoding.
> 
> When I ran a check at W3C I got the following message:
> 
> Warning: Character Encoding mismatch! The character encoding 
> specified in 
> the HTTP header (ォiso-8859-1サ) is different from the one 
> specified in the 
> META element (ォgb2312サ).
> 
> I have just create a subfolder in the web e.g 
> <http://www.domain.com/chinese>www.domain.com/<http://www.doma
in.com/chinese 
 >chinese Is this happening because the browser is reading the encoding 
rom <http://www.domain.com>www.domain.<http://www.domain.com>com and not 
/chinese? Does /chinese have to be converted into a subweb or something?

I would be grateful if someone could shed some light for me here.

Thanks in advance.
Chris
Received on Wednesday, 13 November 2002 11:22:02 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 2 June 2009 19:16:59 GMT