fix integer overflow in unicode case operations (closes #22643)
make sure length is unsigned