JSCK does not support minLength and maxLength tests of unicode surrogate pairs
Closed this issue · 3 comments
automatthew commented
Test in question:
Explanation of unicode surrogate pairs, needed to pass the test:
https://mathiasbynens.be/notes/javascript-encoding
Example of decoding
https://github.com/bestiejs/punycode.js/blob/221463da/punycode.js#L94-L128
automatthew commented
ditto draft4
gilesbowkett commented
note: if/when we get to this, figure out if it affects performance, and if the effect's significant, include an option to turn the feature off for performance reasons.
(this comes from the assumption that the way to implement this is by checking every string for Unicode surrogates whenever minLength
or maxLength
are in a schema.)
gilesbowkett commented
every validator out there neglects to support this also. IIRC consensus was it's an impractical requirement.