Skip to content

Commit d950969

Browse files
committed
Add basic sapi_windows_cp_conv() test
This function is lacking any tests so far.
1 parent 54148fd commit d950969

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
sapi_windows_cp_conv basic functionality
3+
--SKIPIF--
4+
<?php
5+
if (PHP_OS_FAMILY !== 'Windows') die('skip for Windows only');
6+
if (!sapi_windows_cp_set(1252) || !sapi_windows_cp_set(65001)) die('skip codepage not available');
7+
?>
8+
--FILE--
9+
<?php
10+
var_dump(
11+
bin2hex(sapi_windows_cp_conv(65001, 1252, 'äöü')),
12+
bin2hex(sapi_windows_cp_conv('utf-8', 1252, 'äöü')),
13+
bin2hex(sapi_windows_cp_conv(65001, 'windows-1252', 'äöü')),
14+
bin2hex(sapi_windows_cp_conv('utf-8', 'windows-1252', 'äöü')),
15+
);
16+
?>
17+
--EXPECT--
18+
string(6) "e4f6fc"
19+
string(6) "e4f6fc"
20+
string(6) "e4f6fc"
21+
string(6) "e4f6fc"

0 commit comments

Comments
 (0)