my application need to display the greek data from jsp to the excel sheet
but i am not able to display the greek charcaters in excel even after using utf-8 character encoding. i tried with iso-8859-7 also even then its taking by default windows-latin encoding.
my code goes like this:
<%
Vector x = (Vector)session.getAttribute("QRES");
if (x != null)
{
response.setContentType("application/vnd.ms-excel:charset=UTF-8");
response.setHeader("Content-Disposition","attachment;filename=QueryResult.csv");
int iNoOfCols = (new Integer((String)request.getParameter("noOfCols"))).intValue();
String displayNames = ((String)request.getParameter("displayNames"));
out.println(displayNames);
out.println("\r\n");
for(int a = 0; a < x.size(); a = a + iNoOfCols)
{
String eachRow = "";
for (int b = 0; b < iNoOfCols ; b++)
{
if((x.elementAt(a+b)) != null)
{
eachRow=(x.elementAt(a+b)).toString();
}
else
{
eachRow += " ";
}
// comma seperated values...
eachRow += ",";
}
out.println(eachRow);
out.flush();
}
out.close();
}
does excel support UTF-8 character encoding if not do we have anyother alternative for this? wud be thankful if anyone cud provide solution for this