asales Expert Licensed User Longtime User Oct 2, 2017 #1 I use the SaveCSV to export data from sqlite database (list from DBUtils.ExecuteMemoryTable) and I have a problem in accented letters. Excel don't read correctly this letters and return unrecognized character. I don't want to use the Excel library, because I have a false positive in Comodo Antivirus, using this library. Is there a way to uses the SaveCSV with the correct encoding (ANSI) that read by Excel in CSV files? Thanks in advance for any tip.
I use the SaveCSV to export data from sqlite database (list from DBUtils.ExecuteMemoryTable) and I have a problem in accented letters. Excel don't read correctly this letters and return unrecognized character. I don't want to use the Excel library, because I have a false positive in Comodo Antivirus, using this library. Is there a way to uses the SaveCSV with the correct encoding (ANSI) that read by Excel in CSV files? Thanks in advance for any tip.
Erel B4X founder Staff member Licensed User Longtime User Oct 2, 2017 #2 The problem is in Excel. StringUtils.SaveCSV uses UTF8 encoding (without BOM). Adding the BOM might solve it in newer versions of Excel: Code: Copy StringUtils.SaveCSV(...) Dim s As String = File.ReadString (...)' read the file s = Chr(0xFEFF) & s 'add BOM File.WriteString(..., s) Upvote 0
The problem is in Excel. StringUtils.SaveCSV uses UTF8 encoding (without BOM). Adding the BOM might solve it in newer versions of Excel: Code: Copy StringUtils.SaveCSV(...) Dim s As String = File.ReadString (...)' read the file s = Chr(0xFEFF) & s 'add BOM File.WriteString(..., s)