diff --git a/tools/check.go b/tools/check.go index b516237..29bef32 100644 --- a/tools/check.go +++ b/tools/check.go @@ -5,6 +5,7 @@ import ( "os" "regexp" "strings" + "unicode/utf8" ) // CheckParam 检测参数 @@ -78,3 +79,7 @@ func IsKeywords(t string) bool { } return false } + +func IsUtf8(data []byte) bool { + return utf8.Valid(data) +}