[php-src] Issue #9192: mb_convert_encoding wrong characters returned
| From: | RV7PR | Date: | Fri, 29 Jul 2022 11:07:25 +0000 |
| Subject: | [php-src] Issue #9192: mb_convert_encoding wrong characters returned | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-242066@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/9192
Author: RV7PR
### Description
The following code:
```php
<?php
$strings = ['bl', 'Bl', 'Blog'];
foreach ($strings as &$str) {
$str = mb_convert_encoding($str, 'UTF-8', mb_list_encodings());
}
echo '<pre>' . print_r($strings, true) . '</pre>';
```
Resulted in this output:
```
Array
(
[0] => 扬
[1] => 求
[2] => 求杯
)
```
But I expected this output instead:
```
Array
(
[0] => bl
[1] => Bl
[2] => Blog
)
```
### PHP Version
PHP 8.1.8
### Operating System
_No response_