I have a listgrid in which all items are shown properly with diacritics as they are in db both locally and on jboss server.
However, on jboss server, when I try to export as csv all the diacritics characters are replaced so I get something like Școala instead of Școala, although diacritics are shown properly in the listgrid.
Locally works fine both showing in listgrid and exporting.
Here is my code for export:
private void Export() {
String exportAs = (String) m_ExportForm.getField("exportType").getValue();
FormItem item = m_ExportForm.getField("showInWindow");
boolean showInWindow = item.getValue() == null ? false : (Boolean) item.getValue();
// exportAs is either XML or CSV, which we can do with requestProperties
Map<String,String> params= new java.util.HashMap<String, String>();
params.put("Accept-Charset","utf-8");
DSRequest dsRequestProperties = new DSRequest();
dsRequestProperties.setHttpHeaders(params);
dsRequestProperties.setExportValueFields(true);
dsRequestProperties.setExportAs((ExportFormat)EnumUtil.getEnum(ExportFormat.values(), exportAs));
dsRequestProperties.setExportDisplay(showInWindow ? ExportDisplay.WINDOW : ExportDisplay.DOWNLOAD);
// TODO: move in user-config
dsRequestProperties.setExportTitleSeparatorChar("_");
dsRequestProperties.setExportDelimiter(";");
dsRequestProperties.setExportFilename("export." + extensionsValueMap.get(exportAs));
dsRequestProperties.setContentType("text/csv; charset=UTF-8");
m_Target.Export(dsRequestProperties);
Close();
}
Also, in my jboss 7 property file I have this:
<system-properties>
<property name="org.apache.catalina.connector.URI_ENCODING" value="UTF-8"/>
<property name="org.apache.catalina.connector.USE_BODY_ENCODING_FOR_QUERY_STRING" value="true"/>
</system-properties>
which works as the listgrids show diacritics properly.
Also, in my web.xml I have for my servlet
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
Maybe I'm on a wrong track and this is caused by something else.
Both the file exported locally and the file exported from jboss server have the exact file size.
Also, for my Jboss jvm I set the property for java_opts
-Dfile.encoding=UTF-8
EDIT: added the params map due to suggestion. Still nothing.