Fix error mb_convert_encoding(): Argument #3 ($from_encoding) contains invalid encoding "windows-1256" #21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Released under the GNU Affero General Public License (AGPL), version 3.
What does this implement/fix? Explain your changes.
Fixes the error below happening all the time when running Z-Push with PHP 8 (
mb_convert_encoding
now throws an error when$to_encoding
or$from_encoding
is an invalid encodig):The fix is copied from nextcloud/mail#5593. More information there.
Does this close any currently open issues?
At the time of this PR I haven't found any open issue about this error.
Any relevant logs, error output, etc?
See error log above.
Where has this been tested?
Server (please complete the following information):
Smartphone (please complete the following information):
The log above is found for POST /Microsoft-Server-ActiveSync queries with at least these DeviceType:
This is probably not exhaustive.
I'm not familiar at all with Z-Push's code base, feel free to modify however you think is best, or close and open an other PR with a better fix.