Problem with SpreadsheetML Files encoded in Shift-JIS while converting to XLSX using Aspose.Cells for Java

We have a tool that generates reports and the output is in SpreadsheetML (Excel 2003 XML Format) encoded in Shift-JIS. I’m trying to use Aspose to convert these into .xlsx. The file I get out has a lot of moji-bake in place of all the Japanese text. If I load them into Excel (which displays fine) and resave them it converts them to UTF-8 and the conversion in Aspose works fine. I’m looked through the API and I don’t see a way to set the encoding when reading the file. The beginning of the XML does specify the encoding as Shift-JIS.


<?xml version="1.0" encoding="shift-jis"?>

Is there an easy way to read in SpreadsheetML files encoded in Shift-JIS?

I found a solution reading the xml file into a byte array and using CharSetDecoder to convert it into a UTF-16 string. That has worked for all the files I tested it on.

Hi Charles,


It is good to know that you are able to find a workaround to your presented scenario. However, when we tested the case on our side while using the latest version of Aspose.Cells for Java (Latest Version) and a SpreadsheetML (encoded in Shift-JIS) of our own, we were unable to observe any problem while loading or conversion processes. Please give a try to the latest version (link shared above). In case the problem persists, please provide us one of the samples from your side along with it’s converted XLSX file. We will thoroughly investigate the matter to update you in this regard.