Below is my sample VB.Net code to generate CSV file but I don't find a way to specify UTF-8 encoding. Can anyone help me on this?
Public Sub GenerateCsvFile(ByVal dt As DataTable, ByVal strFilePath As String)
Dim workbook As SpreadsheetGear.IWorkbook
Dim worksheet As SpreadsheetGear.IWorksheet
workbook = SpreadsheetGear.Factory.GetWorkbook()
worksheet = workbook.Worksheets("Sheet1")
Dim cells As SpreadsheetGear.IRange
cells = worksheet.Cells("A1")
cells.CopyFromDataTable(dt, Data.SetDataFlags.AllText)
workbook.SaveAs(strFilePath, SpreadsheetGear.FileFormat.CSV)
worksheet = Nothing
workbook.Close()
workbook = Nothing
End Sub
Note: The below link which is similar question asked in 2015 and I was wondering with the latest dll has the solution for this