Encodings are tricky to get right, because you have to be consistent about
it at every layer in your system.

A few things you should check -

   1. If its a static file, what is the encoding of the file when saved on
   disk? Open it with notepad, click save-as and see the encoding.
   2. If its a dynamic file generated via a servlet, what encoding are you
   specifying when using OutputStream. If you don't specify anything, it would
   be UTF-8, which is wrong in your case.
   3. Use a http sniffer and see what encoding is set when you remove the
   apache configuration. Perhaps it is sending URF-8 as the default? And fixing
   1 or 2 above could probably fix this.

Aside, I don't think its a bug with IE. Most probably, one of the several
places in which the encoding can be set it is telling ie 'this file is some
encoding other than ISO-8859-1', which is why it is behaving the way it is.

--Sri



On 4 April 2010 05:25, Simon Botting <[email protected]>wrote:

> Hi,
>
> I'm sending a request to get an xml file that I then want to parse.
> the file is in latin-1 / ISO-8859-1  encoded and had the following for
> some reason firefox / chrome seem to parse the file fine but ie8 (I
> haven't tried other ie versions) seems to read it as some other
> character set (I assume utf-8)
>
> the xml file has an encoding tag in its <?xml tag
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <city>
> .....
> </city>
>
>
> I get the following exception:
>
> com.google.gwt.core.client.JavaScriptException: (Error): line 20, char
> 31:An invalid character was found in text content.
>   description: line 20, char 31:An invalid character was found in text
> content.
>
> I assume this is an encoding issue / mismatch but the file is in
> iso-8859-1 and the xml tag has that encoding specified
>
> If I add this line to my apache2.conf:
>
> AddType 'text/xml; charset=ISO-8859-1' xml
>
> this then means that the Response has an additional header:
>
> Content-Type: text/xml; charset=iso-8859-1
>
> which seems to make ie8 parse the xml file ok.
>
> I'm happy to add the AddType directive to my apache config to make it
> work, but if I didn't have that option I'd be looking for some other
> fix.  My question is whether this is a bug or is this something that I
> should be expecting if so  how do you parse an xml file in ie8 that's
> in iso-8859-1 encoding without setting a response header?
>
> Cheers
> Simon
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-web-toolkit%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to