Closed CooperWolfe closed 2 years ago
Thanks for the suggestion, I think this seems like a reasonable change. I'll give your PR a review.
Ultimately it was decided that we not implement this in the suggested way, but instead to update the documentation to instruct users on how to use .Must()
to count grapheme clusters once.
Is your feature request related to a problem? Please describe.
Grapheme clusters (i.e. emojis) may be stored in a C# (unicode) string, but their lengths will be counted as two characters, the grapheme base and additional marks.
Describe the solution you'd like
For intuitive use, it would be nice if FluentValidation took grapheme clusters into account, counting each exactly once.
Describe alternatives you've considered
Getting string length by value.Length (in LengthValidator.cs) could be changed to the value's StringInfo.LengthInTextElements:
Additional Context
N/A