Add @CodePointLength constraint that validates code point length

Description

I propose to add the @CodePointLength that validate the code point length of character sequence is between min and max.
In my application, the surrogate pair character must be counted as one length, Therefore I need to add the custom constraint (The @Size or @Length cannot use because these are counted it as two lengths character)

I think it is very generally constraint. Could you support this constraint on Hibernate Validator?

Environment

None

Activity

Gunnar MorlingOctober 17, 2017 at 8:52 PM

Thanks, it's a great idea and I think we should add it. It also came up during our survey for Bean Validation 2.0 constraints. It didn't make it there, but it's very good to have it in HV.

Kazuki ShimizuOctober 17, 2017 at 4:57 PM

I've submitted a PR.

Fixed

Details

Assignee

Reporter

Participants

Gunnar Morling
Kazuki Shimizu

Pull Request

Components

Fix versions

Affects versions

Priority

Created October 17, 2017 at 4:25 PM
Updated October 19, 2017 at 4:09 PM
Resolved October 19, 2017 at 2:24 PM