您好,经过调研,这种奇怪的行为是由不正确的用 Workbook.setCulture 法引起的。 下面是更新的代码: - Workbook workbook = new Workbook();
- // 1. Culture is init-only
- // 2. Use Locale.CHINA for Simplified Chinese
- workbook.setCulture(Locale.CHINA);
- SjsOpenOptions options = new SjsOpenOptions();
- options.setIncludeFormulas(true);
- options.setIncludeStyles(true);
- workbook.open("The path to input.sjs", options);
- // 3. Avoid memory leak
- try (FileOutputStream fs = new FileOutputStream("The path to output.ssjson")) {
- workbook.toJson(fs);
- }
复制代码
|