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--EXPECT--
38bool(true)
39string(2) "��"
40bool(true)
41string(4) "����"
42bool(true)
43string(6) "������"
44bool(true)
45string(8) "��������"
46bool(true)
47string(3) "��a"
48bool(true)
49string(5) "��a��"
50bool(true)
51string(6) "��a��a"
52bool(true)
53string(8) "��a��a��"
54bool(true)
55string(7) "��a����"
56bool(true)
57string(9) "��a������"
58bool(true)
59string(11) "��a��������"
60