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

Fix utf8_encode deprecation #1722

Merged
merged 4 commits into from Jul 22, 2022
Merged

Fix utf8_encode deprecation #1722

merged 4 commits into from Jul 22, 2022

Conversation

erikn69
Copy link
Contributor

@erikn69 erikn69 commented Jun 28, 2022

Closes #1718

Comment on lines 180 to 184
return base64_encode(
function_exists('mb_convert_encoding')
? mb_convert_encoding($json, 'UTF-8', mb_list_encodings())
: utf8_encode($json)
);
Copy link
Owner

Choose a reason for hiding this comment

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

I think we can actually skip the encoding here, as json_encode will produce utf-8 or fail since json must be utf-8. And we also have JSON_INVALID_UTF8_SUBSTITUTE in the Utils::DEFAULT_JSON_FLAGS now so it is really useless I think.

Anyway I'll fix the patch.

@Seldaek Seldaek merged commit 27dc1b2 into Seldaek:2.x Jul 22, 2022
@Seldaek Seldaek added this to the 2.x milestone Jul 22, 2022
@Seldaek Seldaek added the Bug label Jul 22, 2022
@Seldaek
Copy link
Owner

Seldaek commented Jul 22, 2022

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants