Encoding problem in JExcel

一曲冷凌霜 提交于 2019-11-30 17:32:28

OK, I got it by doing this:

WorkbookSettings ws = new WorkbookSettings();
ws.setEncoding("Cp1252");
Workbook workbook = Workbook.getWorkbook(stream, ws);

WorkbookSettings will look for system property jxl.encoding

If you don't have easy access to WorkbookSettings (i.e. coming from Drools- ExcelParser) you might find this preferable.

First up, make sure you're using a recent version of POI (something like 3.7 or 3.8 beta 2). Very old versions of POI did have encoding problems, but as long as you're on a new one then that shouldn't be your issue.

Next, on your local machine, run something like org.apache.poi.hssf.extractor.ExcelExtractor against the file. This will let you confirm that POI is handling the encoding correctly. Run it with

java -classpath poi-3.8-beta2.jar org.apache.poi.hssf.extractor.ExcelExtractor --show-sheet-names Y -i MyExcel.xls

Assuming that works fine, then you know your issue is within Google App Engine.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!