We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
utf8_encode
Hello,
I encountered an issue with the following code: utf8_encode() deprecated
utf8_encode()
Carbon/src/Carbon/Traits/Date.php
Line 1856 in 88ac19c
Carbon version: latest
PHP version: 8.2
https://php.watch/versions/8.2/utf8_encode-utf8_decode-deprecated
Suggestion:
return static::$utf8 ? (function_exists('mb_convert_encoding') ? mb_convert_encoding($formatted, 'UTF-8', mb_list_encodings()) : utf8_encode($formatted)) : $formatted;
Thanks!
The text was updated successfully, but these errors were encountered:
Hi, thanks for the report. mb_convert_encoding is recommended as a replacement in the official documentation so your suggestion is good.
mb_convert_encoding
As the Carbon method formatLocalized it's in is also deprecated, we'll get rid of all that in a later version.
formatLocalized
Would you mind to create a pull-request for it?
Maybe indent both ternary for readability:
return static::$utf8 ? (function_exists('mb_convert_encoding') ? mb_convert_encoding($formatted, 'UTF-8', mb_list_encodings()) : utf8_encode($formatted) ) : $formatted;
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Hello,
I encountered an issue with the following code:
utf8_encode()
deprecatedCarbon/src/Carbon/Traits/Date.php
Line 1856 in 88ac19c
Carbon version: latest
PHP version: 8.2
https://php.watch/versions/8.2/utf8_encode-utf8_decode-deprecated
Suggestion:
Thanks!
The text was updated successfully, but these errors were encountered: