mirror of
https://github.com/php/php-src.git
synced 2026-04-25 17:08:14 +02:00
Added test cases for new functionality
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
--TEST--
|
||||
htmlentities() test 15 (setlocale / KOI8-R)
|
||||
--INI--
|
||||
output_handler=
|
||||
default_charset=
|
||||
mbstring.internal_encoding=none
|
||||
--SKIPIF--
|
||||
<?php
|
||||
$result = (bool)setlocale(LC_CTYPE, "ru_RU.koi8r");
|
||||
if (!$result || preg_match('/koi8/i', setlocale(LC_CTYPE, 0)) == 0) {
|
||||
die("skip setlocale() failed\n");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
setlocale(LC_CTYPE, "ru_RU.koi8r");
|
||||
$str = "ÒÏÓËÏÛÎÙÊ";
|
||||
var_dump($str, htmlentities($str, ENT_QUOTES, ''));
|
||||
?>
|
||||
--EXPECT--
|
||||
string(9) "ÒÏÓËÏÛÎÙÊ"
|
||||
string(63) "роскошный"
|
||||
@@ -0,0 +1,23 @@
|
||||
--TEST--
|
||||
htmlentities() test 16 (mbstring / cp1251)
|
||||
--INI--
|
||||
output_handler=
|
||||
--SKIPIF--
|
||||
<?php
|
||||
extension_loaded("mbstring") or die("skip mbstring not available\n");
|
||||
mb_internal_encoding('cp1251');
|
||||
$php_errormsg = NULL;
|
||||
@htmlentities("\x88\xa9\xd2\xcf\xd3\xcb\xcf\xdb\xce\xd9\xca", ENT_QUOTES, '');
|
||||
if ($php_errormsg) {
|
||||
die("skip cp1251 chracter set is not supported on this platform.\n");
|
||||
}
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
mb_internal_encoding('cp1251');
|
||||
$str = "\x88\xa9\xf0\xee\xf1\xea\xee\xf8\xed\xfb\xe9";
|
||||
var_dump($str, htmlentities($str, ENT_QUOTES, ''));
|
||||
?>
|
||||
--EXPECT--
|
||||
string(11) "ˆ©ÒÏÓËÏÛÎÙÊ"
|
||||
string(63) "€©роскошный"
|
||||
Reference in New Issue
Block a user