diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-05-04 11:46:54 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-05-04 11:50:03 +0200 |
commit | d950969e596acc15c8155de6f2a20b6cf50cf45e (patch) | |
tree | 44e378c36b73630e347d8cb5b3c49a5965c6fc49 | |
parent | 54148fd68677e8b13b5a11c309c601d1248fb78b (diff) | |
download | php-git-d950969e596acc15c8155de6f2a20b6cf50cf45e.tar.gz |
Add basic sapi_windows_cp_conv() test
This function is lacking any tests so far.
-rw-r--r-- | ext/standard/tests/strings/sapi_windows_cp_conv.phpt | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ext/standard/tests/strings/sapi_windows_cp_conv.phpt b/ext/standard/tests/strings/sapi_windows_cp_conv.phpt new file mode 100644 index 0000000000..6360fa02ab --- /dev/null +++ b/ext/standard/tests/strings/sapi_windows_cp_conv.phpt @@ -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" |