php-activerecord icon indicating copy to clipboard operation
php-activerecord copied to clipboard

Fix string length

Open visavi opened this issue 9 years ago • 3 comments

In different encodings such as UTF-8, the validator incorrectly believed the string length

visavi avatar Nov 11 '16 12:11 visavi

Thanks for your contribution. Please add a test for the faulty behavior.

koenpunt avatar Nov 12 '16 11:11 koenpunt

screen before and after

visavi avatar Nov 13 '16 01:11 visavi

This change assumes the encoding is always UTF-8. But it is not. In my project, the DB connection's encoding is KOI8-R for example (I can't change it to UTF-8 for many reasons). And it will fail to check string length after this change.

A agree that UTF-8 is more common these days, but I think this problem requires more work. At least configurable encoding that respects DB connection's encoding.

xak2000 avatar Jul 27 '17 03:07 xak2000