problem exporting file depending to computer regional settings

goodmoring to all

The problem I face is the following :

We need to export some data as an excel-csv file, with greek characters. And everything works fine, as long as the computer (where the server is hosted) regional settings are set to Greece. But if we have English settings, we get every greek character as a '?'. The code is the following

HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();

String filename ="requests.csv";

byte [] csvData =csvData=second.getBytes();

String header="attachment; filename="+filename;

response.setHeader("Content-disposition", header );

response.setContentLength(csvData.length);

response.setContentType("application/msexcel;charset=UTF-8");

try{

response.getOutputStream().write(csvData);

response.getOutputStream().write(csvData);

response.getOutputStream().flush();

response.getOutputStream().close();

}

catch(IOException ioe){}

context.responseComplete()

;

[1390 byte] By [markos_da] at [2007-11-27 10:20:43]
# 1

If you computer with English settings does not have the fonts to render Greek characters, that is what happens. I bet that if you look at the file in a hex editor, you will see it is correct.

RaymondDeCampoa at 2007-7-28 17:05:19 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...