mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-30 05:18:49 +01:00
🎨 Non-UTF-8 encoded text files are not included in asset file content searching Fix https://github.com/siyuan-note/siyuan/issues/9052
This commit is contained in:
parent
f4e840fae6
commit
4baeeed1ec
1 changed files with 6 additions and 0 deletions
|
|
@ -26,6 +26,7 @@ import (
|
|||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"code.sajari.com/docconv"
|
||||
"github.com/88250/gulu"
|
||||
|
|
@ -516,6 +517,11 @@ func (parser *TxtAssetParser) Parse(absPath string) (ret *AssetParseResult) {
|
|||
return
|
||||
}
|
||||
|
||||
if !utf8.Valid(data) {
|
||||
// Non-UTF-8 encoded text files are not included in asset file content searching https://github.com/siyuan-note/siyuan/issues/9052
|
||||
return
|
||||
}
|
||||
|
||||
content := string(data)
|
||||
ret = &AssetParseResult{
|
||||
Content: content,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue