X Tutup
Skip to content

[full-ci] Convert from utf8_encode to mb_convert_encoding#40158

Merged
phil-davis merged 1 commit intomasterfrom
utf8_encode-mb_convert_encoding
Jun 21, 2022
Merged

[full-ci] Convert from utf8_encode to mb_convert_encoding#40158
phil-davis merged 1 commit intomasterfrom
utf8_encode-mb_convert_encoding

Conversation

@phil-davis
Copy link
Contributor

@phil-davis phil-davis commented Jun 21, 2022

Description

https://wiki.php.net/rfc/remove_utf8_decode_and_utf8_encode

https://www.php.net/manual/en/function.utf8-encode.php is being deprecated in PHP 8.2 and removed at some time in the future. I happened to notice this while looking at other things. There is an easy change to https://www.php.net/mb_convert_encoding so, IMO, we may as well do it now.

https://github.com/sabre-io/http/blob/master/CHANGELOG.md#500-alpha1-2018-02-16
Sabre\HTTP\URLUtil was removed back in 2018 and the code has changed anyway, so I removed the out-dated comment related to that.

I added a unit test case for filename pound-cent-AE-%A3%A2%C6-in-ISO-8859-1 - that has 3 ISO8859-1 "Latin-1" special characters in it. For that case, the code goes through the changed line and does produce the expected UTF-8 encoding. That unit test case passes with the previous code (I ran it manually), and still passes with the changed code. So there is not any obvious regression.

Related Issue

How Has This Been Tested?

CI

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:
  • Changelog item, see TEMPLATE

@phil-davis phil-davis self-assigned this Jun 21, 2022
@phil-davis phil-davis force-pushed the utf8_encode-mb_convert_encoding branch from d88c4af to 17f56e0 Compare June 21, 2022 09:55
@phil-davis phil-davis marked this pull request as ready for review June 21, 2022 09:58
@owncloud owncloud deleted a comment from update-docs bot Jun 21, 2022
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@phil-davis phil-davis merged commit 89c6b03 into master Jun 21, 2022
@delete-merged-branch delete-merged-branch bot deleted the utf8_encode-mb_convert_encoding branch June 21, 2022 11:14
@jnweiger
Copy link
Contributor

jnweiger commented Sep 9, 2022

Confirmed fixed in 10.11.0-rc.1

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.

3 participants

X Tutup