Cells to PDF does not transform non-english characters (Mojibake)

Hi,


When using Aspose.Cells to PDF a document with Japanese text the generated file results in all question marks.

“げんきですか?” becomes "???????"
See attached file.

Regards
Nick

Hi,

Thanks for your posting and using Aspose.Cells for Java.

Please download and use the latest version: Aspose.Cells for Java (Latest Version). It works fine. I have attached the output pdf for your reference.

Java


String filePath = “F:\Shak-Data-RW\Downloads\test-international.xls”;

Workbook workbook = new Workbook(filePath);


workbook.save(filePath + “.out.pdf”);


Hi,


That’s crazy. I’ve tested with the simplest code outside our main application so its only use whatever environment my system has, and it’s still not working. Did you set a locale before running the command?

I’ve included some of my Windows and Java environment below if that helps.
JAVA_HOME=C:\devenv\Tools\Java\jdk1.7.0_05
OS=Windows_NT
sun.jnu.encoding -> Cp1252
file.encoding -> Cp1252

My guess is its something to do with how the file is written out and what encoding is being used. I’ve see thing type of problem when writing data to a database where no explicit encoding was set. Java will attempt to convert to the current locale. In this case Cp1252 does not support Japanese. So I’m interested to know what your test environment encoding is? We don’t have the luxury of choosing ours as it depends on the user who is using the software.

Regards
Nick

Hi,

Thanks for your posting and using Aspose.Cells for Java.

Your problem might be occurring because of fonts. Please install the missing fonts and set the font directory using CellsHelper.setFontDir method. Please also use the latest version: Aspose.Cells for Java (Latest Version)