Duplicate content-type in html code
Hi all, The source of served pages contains a duplicate content type (just use view source on any page of xwiki...) <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title> XWiki.org - Community - WebHome </title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <meta name="revisit-after" content="7 days" /> <meta name="description" content="Free Wiki on XWiki.com" /> <meta name="keywords" content="wiki" /> <meta name="distribution" content="GLOBAL" /> <meta name="rating" content="General" /> <meta name="author" content="" /> <meta http-equiv="reply-to" content="" /> <meta name="language" content="en" /> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> ... The first one is generated by XWiki, the second comes from the HTTP Meta Inofrmation of the presentation preferences, as given by the xwiki-1.0-beta-3.xar This may usually not be a problem, but in a UTF-8 environment, it gives 2 different contents (the first one being (correctly) UTF-8, the second being ISO-8859-1. This meta information should be removed from the xwiki xar at it is now obsolete. If, for reason I do not know it is to be kept, then the document presenting settings of an UTF-8 xwiki should be updated. Regards, Gilles, -- Gilles Sérasset GETA-CLIPS-IMAG (UJF, INPG & CNRS) BP 53 - F-38041 Grenoble Cedex 9 Phone: +33 4 76 51 43 80 Fax: +33 4 76 44 66 75
Hi Gilles, On Feb 10, 2007, at 1:08 PM, Gilles Serasset wrote:
Hi all,
The source of served pages contains a duplicate content type (just use view source on any page of xwiki...)
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title> XWiki.org - Community - WebHome </title> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <meta name="revisit-after" content="7 days" /> <meta name="description" content="Free Wiki on XWiki.com" /> <meta name="keywords" content="wiki" /> <meta name="distribution" content="GLOBAL" /> <meta name="rating" content="General" /> <meta name="author" content="" /> <meta http-equiv="reply-to" content="" /> <meta name="language" content="en" /> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> ...
The first one is generated by XWiki, the second comes from the HTTP Meta Inofrmation of the presentation preferences, as given by the xwiki-1.0-beta-3.xar
This may usually not be a problem, but in a UTF-8 environment, it gives 2 different contents (the first one being (correctly) UTF-8, the second being ISO-8859-1.
This meta information should be removed from the xwiki xar at it is now obsolete.
If, for reason I do not know it is to be kept, then the document presenting settings of an UTF-8 xwiki should be updated.
I agree that there shouldn't be 2 Content-Type in the generated page. I think I've found where the XWiki one is generated. In Utils.java we have: public static void parseTemplate(String template, boolean write, XWikiContext context) throws XWikiException { ... // Set content-type and encoding (this can be changed in the future by pages themselves) if (context.getResponse() instanceof XWikiPortletResponse) { response.setContentType("text/html"); } else { response.setContentType("text/html; charset=" + context.getWiki().getEncoding()); } This should probably be corrected and the response.setContentType only set if there's no such wiki preferences defined. I also agree to remove the Content-Type in the XWikiPreferences page for the default wiki Thanks -Vincent ___________________________________________________________________________ Yahoo! Mail r�invente le mail ! D�couvrez le nouveau Yahoo! Mail et son interface r�volutionnaire. http://fr.mail.yahoo.com
participants (2)
-
Gilles Serasset -
Vincent Massol