Fluent min length validation incorrect when using chinese character

22 Views Asked by At

I have the following fluent validator, which works fine when the characters are in english but fails when charcaters are in chinese.

How can i instruct it that characters are unicode and it should validate it accordingly.

RuleFor(x => x.FirstName)
    .NotEmpty().WithMessage("Please specify FirstName")
    .MaximumLength(500).MinimumLength(3);
0

There are 0 best solutions below