xsl-list
[Top] [All Lists]

Re: [xsl] HTTP-Header charset different to charset encoding statement in XML-Declaration

2010-03-12 08:41:29
Hi,

I'm a little rusty on this, but if I remember correctly most browsers
will first try to identify the content using the HTTP header and use
the HTTP body or even the file extension as second options. Some
browsers gave preference to file extension before body.

One way to find out what standard browser behavior 'should' be, is to
test against Internet Explorer and then do exactly the opposite ;-)

Cheers,
Jacobus

On Fri, Mar 12, 2010 at 3:44 PM, Bartolomeo Nicolotti
<bnicolotti(_at_)siapcn(_dot_)it> wrote:
Hello,

only a quick question. I've to handle xml in the body of an HTTP response.
The problem is that  http header can specify an encoding different from the 
processing instruction, like here:

HTTP-Header:

Content-Type: application/xhtml+xml; charset=UTF-8


 1: <?xml version="1.0" encoding="ISO-8859-1"?>
 2: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 3:      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
 4:
 5: <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="de" lang="de">
 6:   <head>
 7:     <title>HTTP != XML</title>
 8:   </head>
 9:   <body>äöüÄÖÜß</body>
 10: </html>

Which encoding has precedence? The http header or the processing instruction?

Many thanks

Best regards

Bartolomeo Nicolotti





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





-- 
Good ideas will be done

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>