beberlei / assert

Thin assertion library for use in libraries and business-model
Other
2.41k stars 188 forks source link

makeing Assertion::stringify UTF-8 safe #290

Open carp3 opened 4 years ago

carp3 commented 4 years ago

Currently asserting string length with a UTF-8 string will cause a message like this:

image

which contains an invalid UTF-8 character. it's because of substr function ( it's not UTF-8 safe )

I fixed this issue by using mb_substr instead of substr