xref: /PHP-8.2/ext/mbstring/tests/gh10627.phpt (revision ed0c0df3)
1--TEST--
2GH-10627 (mb_convert_encoding crashes PHP on Windows)
3--EXTENSIONS--
4mbstring
5--FILE--
6<?php
7
8$str = 'S�kinst�llningar';
9$data = [$str, 'abc'];
10var_dump(mb_convert_encoding($data, 'UTF-8', 'auto'));
11$data = [$str => 'abc', 'abc' => 'def'];
12var_dump(mb_convert_encoding($data, 'UTF-8', 'auto'));
13
14?>
15--EXPECTF--
16Warning: mb_convert_encoding(): Unable to detect character encoding in %s on line %d
17array(1) {
18  [1]=>
19  string(3) "abc"
20}
21
22Warning: mb_convert_encoding(): Unable to detect character encoding in %s on line %d
23array(1) {
24  ["abc"]=>
25  string(3) "def"
26}
27