This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills: The software developer's life manual and have John Sonmez on-line!
See this thread for details.
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

display of japanese characters in excel sheet

 
Rajeev Desh
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic