add validate:len=? support for utf-8

pull/111/head
zhing 10 years ago
parent 61e4429b20
commit 0fa8dd2a3e
  1. 2
      baked_in.go

@ -546,7 +546,7 @@ func hasLengthOf(top interface{}, current interface{}, field interface{}, param
case reflect.String: case reflect.String:
p := asInt(param) p := asInt(param)
return int64(len(st.String())) == p return int64(len([]rune(st.String()))) == p
case reflect.Slice, reflect.Map, reflect.Array: case reflect.Slice, reflect.Map, reflect.Array:
p := asInt(param) p := asInt(param)

Loading…
Cancel
Save