mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 10:30:13 +01:00
🎨 Improve export CSV
This commit is contained in:
parent
1f8c651dc4
commit
6cb6161608
1 changed files with 6 additions and 1 deletions
|
|
@ -93,8 +93,13 @@ func ExportAv2CSV(avID string) (zipPath string, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
writer := csv.NewWriter(f)
|
||||
if _, err = f.WriteString("\xEF\xBB\xBF"); nil != err { // 写入 UTF-8 BOM,避免使用 Microsoft Excel 打开乱码
|
||||
logging.LogErrorf("write UTF-8 BOM to [%s] failed: %s", csvPath, err)
|
||||
f.Close()
|
||||
return
|
||||
}
|
||||
|
||||
writer := csv.NewWriter(f)
|
||||
var header []string
|
||||
for _, col := range table.Columns {
|
||||
header = append(header, col.Name)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue