2002-08-04 14:20:11 +00:00
|
|
|
--TEST--
|
|
|
|
HTML input/output
|
|
|
|
--SKIPIF--
|
|
|
|
<?php
|
|
|
|
ini_set('include_path','.');
|
2002-10-30 08:06:52 +00:00
|
|
|
extension_loaded('mbstring') or die('skip mbstring not available');
|
2002-08-04 14:20:11 +00:00
|
|
|
?>
|
|
|
|
--INI--
|
2004-08-02 08:27:57 +00:00
|
|
|
output_buffering=4096
|
2002-10-28 00:02:25 +00:00
|
|
|
output_handler=mb_output_handler
|
|
|
|
zlib.output_compression=
|
2004-08-02 08:27:57 +00:00
|
|
|
arg_separator.input=x
|
2002-08-04 14:20:11 +00:00
|
|
|
error_reporting=0
|
|
|
|
mbstring.http_input=HTML-ENTITIES
|
2004-08-02 08:27:57 +00:00
|
|
|
mbstring.internal_encoding=UTF-8
|
2002-08-04 14:20:11 +00:00
|
|
|
mbstring.http_output=HTML-ENTITIES
|
2002-10-28 00:02:25 +00:00
|
|
|
mbstring.encoding_translation=1
|
2002-08-04 14:20:11 +00:00
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
// enable output encoding through output handler
|
2004-08-02 08:27:57 +00:00
|
|
|
//ob_start("mb_output_handler");
|
2002-08-04 14:20:11 +00:00
|
|
|
// @... are must be decoded on input these are not reencoded on output.
|
|
|
|
// If you see @AB on output this means input encoding fails.
|
|
|
|
// If you do not see ä... on output this means output encoding fails.
|
|
|
|
// Using UTF-8 internally allows to encode/decode ALL characters.
|
|
|
|
// &128... will stay as they are since their character codes are above 127
|
|
|
|
// and they do not have a named entity representaion.
|
|
|
|
?>
|
|
|
|
<?php echo mb_http_input('l').'>'.mb_internal_encoding().'>'.mb_http_output();?>
|
|
|
|
|
2004-10-09 08:16:29 +00:00
|
|
|
<?php mb_parse_str("test=&@AB€‚äöü€⟨⟩", $test);
|
|
|
|
print_r($test);
|
2002-08-04 14:20:11 +00:00
|
|
|
?>
|
2004-08-02 08:27:57 +00:00
|
|
|
===DONE===
|
2002-08-04 14:20:11 +00:00
|
|
|
--EXPECT--
|
|
|
|
HTML-ENTITIES>UTF-8>HTML-ENTITIES
|
2004-10-09 08:16:29 +00:00
|
|
|
Array
|
|
|
|
(
|
|
|
|
[test] => &@AB€‚äöü€⟨⟩
|
|
|
|
)
|
2004-08-02 08:27:57 +00:00
|
|
|
===DONE===
|