asaskevich / govalidator

[Go] Package of validators and sanitizers for strings, numerics, slices and structs
MIT License
5.97k stars 554 forks source link

Count grapheme clusters #157

Open bejayoharen opened 7 years ago

bejayoharen commented 7 years ago

Not sure if this is in the scope of the project, but it would be useful to have an accurate way to count grapheme clusters, and I don't know another way to do this in Go.

http://stackoverflow.com/questions/36928185/counting-characters-in-golang-string http://unicode.org/reports/tr29/#Grapheme_Cluster_Boundaries

(The reason I thought this might be in-scope, is I thought it would be useful in validating strings as too long or two short.)

sergeyglazyrindev commented 2 years ago

Hello guys! I forked this package cause owner disappeared. Hope, he will be back, but it would be easier to merge these changes back if he is back Link to my repo: create issue there and we'll discuss it.