summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/standard/tests/strings/sapi_windows_cp_conv.phpt21
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"