cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robby Pelssers" <>
Subject RE: wrong encoding used when opening xml file with encoding utf-8
Date Mon, 13 Sep 2010 14:59:27 GMT

Hi chris,

newer versions of excel support reading data from the web in xml format...  Excel can even
read in complete webpages containing html tables and that was the use case I was talking about.

So i'm sorry about any confusion by not specifying exaclty what i was trying to do.


-----Oorspronkelijk bericht-----
Van: Christopher Schultz []
Verzonden: ma 13-9-2010 15:46
Onderwerp: Re: wrong encoding used  when opening xml file with encoding utf-8
Hash: SHA1


On 9/13/2010 8:31 AM, Robby Pelssers wrote:
> I'm generating an html table using Chinese characters and i set the encoding and mimetype
as follows:
> 	var response = cocoon.response;		
> 	response.setContentType("application/; charset=utf-8");	

Uh, isn't application/ a binary file format? It shouldn't
have a charset in it's content type.

> 	response.setHeader(
> 	    "Content-Disposition",
> 	    "attachment; filename=" + id + ".xls"
> 	);		
> 	cocoon.sendPage(
> 		"chemicalcontent/excel/" + rohs + "/" + id + ".xls"
> 	);	
> When previewing the html table in the browser it displays the chinese characters ok.
But when i click the download link and i open the file with excel, it always takes Western
European as charset.. I can manually change that and reload the file but am I missing something
or is excel unable to open an xml file using the correct encoding?

Maybe a sample of the file you're trying to send would be helpful.

> Ok... i found the solution:
> I had to add following META as well to the generated html:
> 	    <head>
> 	      <meta http-equiv="Content-Type" content="application/; charset=utf-8"
> 	    </head>

I'm completely confused: you have a Microsoft Excel (.xls) file that is
XML and also contains HTML <head> and <meta> tags? No wonder Microsoft
Excel can't read it.

- -chris
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message