summaryrefslogtreecommitdiff
path: root/ext/standard/tests/general_functions/putenv_bug75574_cp936_win.phpt
blob: eb5187b205d6a6ffefb7d7513085720a729d35d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
--TEST--
Bug #75574 putenv does not work properly if parameter contains non-ASCII unicode character, cp936 Windows
--SKIPIF--
<?php

if (substr(PHP_OS, 0, 3) != 'WIN') {
  die("skip Valid only on Windows");
}
if (!sapi_windows_cp_set(936)) {
	die("skip Required CP 936 or compatible");
}

?>
--INI--
internal_encoding=cp936
--FILE--
<?php
/*
#vim: set fileencoding=cp936
#vim: set encoding=cp936
*/

var_dump(putenv('FOO=°¡'), getenv("FOO"));
var_dump(putenv('FOO=°¡°¡'), getenv("FOO"));
var_dump(putenv('FOO=°¡°¡°¡'), getenv("FOO"));
var_dump(putenv('FOO=°¡°¡°¡°¡'), getenv("FOO"));

var_dump(putenv('FOO=°¡a'), getenv("FOO"));
var_dump(putenv('FOO=°¡a°¡'), getenv("FOO"));
var_dump(putenv('FOO=°¡a°¡a'), getenv("FOO"));
var_dump(putenv('FOO=°¡a°¡a°¡'), getenv("FOO"));
var_dump(putenv('FOO=°¡a°¡°¡'), getenv("FOO"));
var_dump(putenv('FOO=°¡a°¡°¡°¡'), getenv("FOO"));
var_dump(putenv('FOO=°¡a°¡°¡°¡°¡'), getenv("FOO"));

?>
===DONE===
--EXPECTF--	
bool(true)
string(2) "°¡"
bool(true)
string(4) "°¡°¡"
bool(true)
string(6) "°¡°¡°¡"
bool(true)
string(8) "°¡°¡°¡°¡"
bool(true)
string(3) "°¡a"
bool(true)
string(5) "°¡a°¡"
bool(true)
string(6) "°¡a°¡a"
bool(true)
string(8) "°¡a°¡a°¡"
bool(true)
string(7) "°¡a°¡°¡"
bool(true)
string(9) "°¡a°¡°¡°¡"
bool(true)
string(11) "°¡a°¡°¡°¡°¡"
===DONE===