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

[bugfix] #47 Malformed UTF-8 characters, possibly incorrectly encoded #48

Conversation

cybd
Copy link
Contributor

@cybd cybd commented Mar 15, 2023

seeInDatabase() works fine even with binary filter in criteria, but json_encode() produces an error message "Malformed UTF-8 characters, possibly incorrectly encoded" due to binary characters in input. As the result my test is failed due to json_encode.

Adding JSON_INVALID_UTF8_SUBSTITUTE flag to json_encode() fix this issue.

See tests for details.

Copy link
Member

@Arhell Arhell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Naktibalda Naktibalda merged commit 1858892 into Codeception:master Mar 18, 2023
@cybd cybd deleted the 47-Malformed-UTF-8-characters-possibly-incorrectly-encoded branch March 18, 2023 09:50
@@ -294,6 +294,8 @@ public function executeQuery($query, array $params): PDOStatement
$type = PDO::PARAM_BOOL;
} elseif (is_int($param)) {
$type = PDO::PARAM_INT;
} elseif ($this->isBinary($param)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change leads to a type error if $param === null

I just created #63 to fix this issue.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also if $param is a float. Filed issue #64 about that bug.

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.

5 participants