Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makeing Assertion::stringify UTF-8 safe #290

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

carp3
Copy link

@carp3 carp3 commented Oct 1, 2019

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

Fixing stringify to handle UTF-8 texts
@carp3 carp3 changed the title Update Assertion.php Assertion::stringify makeing Assertion::stringify UTF-8 safe Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant