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