1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Add basic sapi_windows_cp_conv() test

This function is lacking any tests so far.
This commit is contained in:
Christoph M. Becker
2020-05-04 11:46:54 +02:00
parent 54148fd686
commit d950969e59

View File

@@ -0,0 +1,21 @@
--TEST--
sapi_windows_cp_conv basic functionality
--SKIPIF--
<?php
if (PHP_OS_FAMILY !== 'Windows') die('skip for Windows only');
if (!sapi_windows_cp_set(1252) || !sapi_windows_cp_set(65001)) die('skip codepage not available');
?>
--FILE--
<?php
var_dump(
bin2hex(sapi_windows_cp_conv(65001, 1252, 'äöü')),
bin2hex(sapi_windows_cp_conv('utf-8', 1252, 'äöü')),
bin2hex(sapi_windows_cp_conv(65001, 'windows-1252', 'äöü')),
bin2hex(sapi_windows_cp_conv('utf-8', 'windows-1252', 'äöü')),
);
?>
--EXPECT--
string(6) "e4f6fc"
string(6) "e4f6fc"
string(6) "e4f6fc"
string(6) "e4f6fc"