-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Robby,
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/vnd.ms-excel; charset=utf-8"); Uh, isn't application/vnd.ms-excel 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/vnd.ms-excel; 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 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkyOKzsACgkQ9CaO5/Lv0PBMAQCghgwa0r0IBR/BpOT8ublnKXal 3GIAn1Xd1cju+fvOswfg7fJVc+EiEJW/ =mGMR -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org For additional commands, e-mail: users-h...@cocoon.apache.org