This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
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
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
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
 
It's not a secret anymore!