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>

Robby


-----Oorspronkelijk bericht-----
Van: Robby Pelssers [mailto:robby.pelss...@ciber.com]
Verzonden: ma 13-9-2010 14:31
Aan: users@cocoon.apache.org
Onderwerp: wrong encoding used  when opening xml file with encoding utf-8
 

Hi all,

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");     
        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?

I know this question is a bit of topic but maybe somebody else ever faced and 
solved this issue.

Kind regards,
Robby Pelssers

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org


<<winmail.dat>>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org

Reply via email to