中文切片乱码
This commit is contained in:
parent
f34f0948f4
commit
492974731a
|
|
@ -52,11 +52,13 @@ func siteAccess(uri *string) error {
|
|||
})
|
||||
|
||||
//保持公平,长度限制
|
||||
if len(title) > 20 {
|
||||
title = title[:20]
|
||||
str := []rune(title)
|
||||
if len(str) > 25 {
|
||||
title = string(str[:25])
|
||||
}
|
||||
if len(description) > 200 {
|
||||
description = description[:200]
|
||||
str2 := []rune(description)
|
||||
if len(str2) > 200 {
|
||||
description = string(str2[:200])
|
||||
}
|
||||
|
||||
if title != "" {
|
||||
|
|
|
|||
Loading…
Reference in New Issue