[Bug #20305] Fix matching against an incomplete character
When matching against an incomplete character, some `enclen` calls are
expected not to exceed the limit, and some are expected to return the
required length and then the results are checked if it exceeds.
merge revision(s) 3a04ea2d0379dd8c6623c2d5563e6b4e23986fae: [Backport #20305]