mirror of
https://github.com/shadow1ng/fscan.git
synced 2025-07-13 21:02:44 +08:00
fix: 修复中文标题截取导致乱码的问题
This commit is contained in:
parent
3dfd2e9e30
commit
41b8939b0b
@ -210,8 +210,9 @@ func gettitle(body []byte) (title string) {
|
||||
title = strings.Replace(title, "\n", "", -1)
|
||||
title = strings.Replace(title, "\r", "", -1)
|
||||
title = strings.Replace(title, " ", " ", -1)
|
||||
if len(title) > 100 {
|
||||
title = title[:100]
|
||||
titleRune := []rune(title)
|
||||
if len(titleRune) > 5 {
|
||||
title = string(titleRune[:100])
|
||||
}
|
||||
if title == "" {
|
||||
title = "\"\"" //空格
|
||||
|
Loading…
Reference in New Issue
Block a user