diff options
Diffstat (limited to 'sapi/cgi/tests/bug75574_utf8.phpt')
| -rw-r--r-- | sapi/cgi/tests/bug75574_utf8.phpt | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/sapi/cgi/tests/bug75574_utf8.phpt b/sapi/cgi/tests/bug75574_utf8.phpt new file mode 100644 index 0000000000..650d4a75f1 --- /dev/null +++ b/sapi/cgi/tests/bug75574_utf8.phpt @@ -0,0 +1,31 @@ +--TEST-- +Bug #75574 putenv does not work properly if parameter contains non-ASCII unicode character, UTF-8 +--SKIPIF-- +<?php +include "skipif.inc"; +?> +--FILE-- +<?php +/* +#vim: set fileencoding=utf-8 +#vim: set encoding=utf-8 +*/ + +include "include.inc"; + +$php = get_cgi_path(); +reset_env_vars(); + +$fn = dirname(__FILE__) . DIRECTORY_SEPARATOR . md5(uniqid()); +file_put_contents($fn, "<?php\nvar_dump(putenv('FOO=啊'));\n//var_dump(`echo %FOO%`);\nvar_dump(getenv('FOO'));"); + +echo shell_exec("$php -n -f $fn"); + +unlink($fn); + +?> +===DONE=== +--EXPECT-- +bool(true) +string(3) "啊" +===DONE=== |
