diff --git a/encoding.go b/encoding.go index c099883..a44f3c5 100644 --- a/encoding.go +++ b/encoding.go @@ -28,3 +28,12 @@ func EncodeXMLIndent(v interface{}) string { b, _ := xml.MarshalIndent(v, " ", " ") return string(b) } + +func HasChinese(str string) bool { + for _, r := range str { + if unicode.Is(unicode.Han, r) { + return true + } + } + return false +}