mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-28 12:28:48 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
e5bc93b4ea
1 changed files with 9 additions and 1 deletions
|
|
@ -70,6 +70,9 @@ func ExportAv2CSV(avID string) (zipPath string, err error) {
|
|||
}
|
||||
|
||||
name := util.FilterFileName(attrView.Name)
|
||||
if "" == name {
|
||||
name = "Untitled"
|
||||
}
|
||||
|
||||
table, err := renderAttributeViewTable(attrView, view)
|
||||
if nil != err {
|
||||
|
|
@ -90,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