xref: /PHP-7.2/sapi/cli/tests/bug44564.phpt (revision b021e04c)
1--TEST--
2Bug #44564 (escapeshellarg removes UTF-8 multi-byte characters)
3--SKIPIF--
4<?php
5if (false == setlocale(LC_CTYPE, "UTF8", "en_US.UTF-8")) {
6	die("skip setlocale() failed\n");
7}
8?>
9--FILE--
10<?php
11setlocale(LC_CTYPE, "UTF8", "en_US.UTF-8");
12var_dump(escapeshellcmd('f{o}<€>'));
13var_dump(escapeshellarg('f~|;*Þ?'));
14var_dump(escapeshellcmd('?€®đæ?'));
15var_dump(escapeshellarg('aŊł€'));
16
17?>
18--EXPECT--
19string(13) "f\{o\}\<€\>"
20string(10) "'f~|;*Þ?'"
21string(13) "\?€®đæ\?"
22string(10) "'aŊł€'"
23