Read CSV File With Multiple Encodings

Aspose.Cells - Read CSV File With Multiple Encodings

Sometimes, your CSV file contains multiple encodings (Unicode, ANSI, UTF‑8, UTF‑7, etc.). Aspose.Cells allows you to load such CSV files and convert them into other formats, for example PDF or XLSX.

Java

 // Set Multi‑Encoded Property to true
 TxtLoadOptions options = new TxtLoadOptions();
 options.setMultiEncoded(true);

 // Load the CSV file into Workbook
 Workbook workbook = new Workbook(dataDir + "MultiEncoded.csv", options);

 // Save it in XLSX format
 workbook.save(dataDir + "EncodedNewFile_Out.xlsx", SaveFormat.XLSX);

Download Running Code

Download Sample Code