1--TEST--
2Bug #75574 putenv does not work properly if parameter contains non-ASCII unicode character, cp936 Windows
3--SKIPIF--
4<?php
5
6if (substr(PHP_OS, 0, 3) != 'WIN') {
7  die("skip Valid only on Windows");
8}
9if (!sapi_windows_cp_set(936)) {
10	die("skip Required CP 936 or compatible");
11}
12
13?>
14--INI--
15internal_encoding=cp936
16--FILE--
17<?php
18/*
19#vim: set fileencoding=cp936
20#vim: set encoding=cp936
21*/
22
23var_dump(putenv('FOO=��'), getenv("FOO"));
24var_dump(putenv('FOO=����'), getenv("FOO"));
25var_dump(putenv('FOO=������'), getenv("FOO"));
26var_dump(putenv('FOO=��������'), getenv("FOO"));
27
28var_dump(putenv('FOO=��a'), getenv("FOO"));
29var_dump(putenv('FOO=��a��'), getenv("FOO"));
30var_dump(putenv('FOO=��a��a'), getenv("FOO"));
31var_dump(putenv('FOO=��a��a��'), getenv("FOO"));
32var_dump(putenv('FOO=��a����'), getenv("FOO"));
33var_dump(putenv('FOO=��a������'), getenv("FOO"));
34var_dump(putenv('FOO=��a��������'), getenv("FOO"));
35
36?>
37===DONE===
38--EXPECT--
39bool(true)
40string(2) "��"
41bool(true)
42string(4) "����"
43bool(true)
44string(6) "������"
45bool(true)
46string(8) "��������"
47bool(true)
48string(3) "��a"
49bool(true)
50string(5) "��a��"
51bool(true)
52string(6) "��a��a"
53bool(true)
54string(8) "��a��a��"
55bool(true)
56string(7) "��a����"
57bool(true)
58string(9) "��a������"
59bool(true)
60string(11) "��a��������"
61===DONE===
62