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()
;

