Skip to content

Commit 2e1d8fd

Browse files
committed
iconv: Fix warning on PHP 8.2
Deprecated: iconv(): Passing null to parameter #1 ($from_encoding) of type string is deprecated in src/IconvTranscoder.php on line 49
1 parent 446f0b1 commit 2e1d8fd

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
44

5+
## unreleased
6+
7+
- Iconv: Fix warning on PHP 8.2 when passing `null` as source encoding.
8+
9+
510
## [1.0.1] – 2021-05-23
611

712
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.

src/IconvTranscoder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function ($no, $message) use ($string) {
4646
);
4747

4848
try {
49-
$result = iconv($from, $to ?: $this->defaultEncoding, $string);
49+
$result = iconv($from ?: '', $to ?: $this->defaultEncoding, $string);
5050
} finally {
5151
restore_error_handler();
5252
}

0 commit comments

Comments
 (0)