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:
21
ext/standard/tests/strings/sapi_windows_cp_conv.phpt
Normal file
21
ext/standard/tests/strings/sapi_windows_cp_conv.phpt
Normal 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"
|
||||
Reference in New Issue
Block a user