Upload Excel file with Japanese font

132 views Asked by At

I have a Japanese Excel ('.xls') file, I need to upload it to server using IExcelDataReader. below is my code:

IExcelDataReader reader;
DataSet dataSet = null;
if (fileExtension == ".xlsx")
{
    // .xlsx
    reader =        ExcelReaderFactory.CreateOpenXmlReader(file.InputStream);
}
else if (fileExtension == ".xls")
{
    // .xls
    reader = ExcelReaderFactory.CreateBinaryReader(file.InputStream);
}
else
{
    response.Error =
        string.Format(Extensions.LabelFor(labelModels, null, 42), file.FileName);
    return response;
}
// cast to data set
dataSet = reader.AsDataSet();
DataTable dataTable = dataSet.Tables[sheetName];

But I can not get Japanese values. Everything is OK with English values. Please let me know why I can not upload .xls file with Japanese language?

It's OK when I change file to .xlsx!

0

There are 0 answers