aspose file tools*
The moose likes JSP and the fly likes display of japanese characters in excel sheet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "display of japanese characters in excel sheet" Watch "display of japanese characters in excel sheet" New topic
Author

display of japanese characters in excel sheet

Rajeev Desh
Greenhorn

Joined: Sep 05, 2008
Posts: 4
Hi all,
I have this peculiar result when I export jsp result to a excel sheet.
I display a set of japanese characters (say in a report) with JSP page. When i click on export to excel button, I find the exported results in excel are having some junc characters.

I display the report in jsp and export to excel using the html tags.
I have the following code in a export to excel jsp page:

<%@ page language="java" contentType="application/vnd.ms-excel; charset=UTF-8" pageEncoding="UTF-8"%>

response.setHeader("Pragma", "public");
response.setHeader("Cache-Control", "max-age=0");
response.setHeader("Content-disposition","attachment; filename=" +fileName );

If anybody came across with such kinda block and resloved it please let me know.

thanks in advance.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42929
    
  68
My guess would be that Excel doesn't pick up on the UTF-8 encoding. This whole HTML-table-pretending-to-be-an-Excel-file thing is highly non-standard.

Do any of the characters appear correctly?
Rajeev Desh
Greenhorn

Joined: Sep 05, 2008
Posts: 4
well, the other english characters appear properly, meanwhile, the japanese characters appear properly in jsp page. The problem is there when it has been exported to excel.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: display of japanese characters in excel sheet