diff --git a/CHANGELOG.md b/CHANGELOG.md index dc37d2b..a897eb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## unreleased + +- Iconv: Fix warning on PHP 8.2 when passing `null` as source encoding. + + ## [1.0.1] – 2021-05-23 The project has been revived and is now available under the name [`fossar/transcoder`](https://packagist.org/packages/fossar/transcoder). This is a first release since the fork. diff --git a/src/IconvTranscoder.php b/src/IconvTranscoder.php index 9fe8825..d2e9d96 100644 --- a/src/IconvTranscoder.php +++ b/src/IconvTranscoder.php @@ -46,7 +46,7 @@ function ($no, $message) use ($string) { ); try { - $result = iconv($from, $to ?: $this->defaultEncoding, $string); + $result = iconv($from ?: '', $to ?: $this->defaultEncoding, $string); } finally { restore_error_handler(); }