Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Use mb_convert_encoding instead of utf8_decode #46132

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

Merged
merged 1 commit into from
Apr 21, 2022

Conversation

fancyweb
Copy link
Contributor

Q A
Branch? 4.4
Bug fix? no
New feature? no
Deprecations? no
Tickets -
License MIT
Doc PR -

Related to https://wiki.php.net/rfc/remove_utf8_decode_and_utf8_encode. Those are the only occurrences in the whole code 😃

@carsonbot carsonbot added this to the 4.4 milestone Apr 21, 2022
Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

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

👍🏻 The arguments in the RFC are enough to remove usage of this functions.

symfony/polyfill-iconv uses this function too; not in tests.
https://github.com/symfony/polyfill/blob/a2dfd477ab70be432885f12f62205ec1d0388b84/src/Iconv/Iconv.php#L454

@stof
Copy link
Member

stof commented Apr 21, 2022

For the iconv polyfill, I think the solution is to change the condition in iconv_strlen to if (\PHP_VERSION_ID < 80200 && $hasXml), so that PHP 8.2+ always uses the strlen2 implementation instead of strlen1 (but keeping strlen1 for older versions, as I think it is a bit faster)

@nicolas-grekas
Copy link
Member

Thank you @fancyweb.

@nicolas-grekas nicolas-grekas merged commit fd1c94b into symfony:4.4 Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.