Java Excel API (jxl), German Umlauts and Linux by @MatthiasReining

jxl and encoding

Java Excel API (jxl), German Umlauts and Linux

Java Excel API is a great library to generate or modify xls-files with Java. On my web application, I use a xls-template, modify some fields and stream the result through a RESTful service. This works pretty good. But if the templates have some German umlauts, the result has 'broken' characters. With following encoding settings the umlauts works:

Loading template: f = new"d:\\out.xls");
OutputStream out = new FileOutputStream(f);
WorkbookSettings settings = new WorkbookSettings();
Workbook template = Workbook.getWorkbook(this.getClass().getResourceAsStream("/template-test.xls"), settings);

Writing Output:

WorkbookSettings settings = new WorkbookSettings();
WritableWorkbook output = Workbook.createWorkbook(out, template, settings);

It is important, that also the template is loaded with encoding Cp1252.