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_deprecation_utf8_decode #29

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

Conversation

LuisParada7
Copy link

Updated the strlen1 function in the Iconv class to use mb_strlen for character counting. This change addresses the deprecation of utf8_decode in PHP 8.2 and ensures accurate character counting for UTF-8 strings, including those with multi-byte characters. The pollyfill-iconv component has not yet been updated to reflect this deprecation, making this change necessary for compatibility with newer PHP versions.

@Julian-Tovar
Copy link
Contributor

Hi @LuisParada7 thank you for your contribution. At this point in time we are opting to use the Core library to solve this issue. In particular we are going to use \core_text::convert which does the same as the utf8 encode and decode functions. The advantage of using the Core library is that we leave the implementation details to Core, so that if in the future, the mb_strlen function or any other is deprecated, we don't have to change anything, because Core will change the implementation details inside of \core_text::convert. Thanks again.

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.

2 participants