xref: /PHP-8.0/ext/mbstring/tests/htmlent.phpt (revision c5401854)
1--TEST--
2HTML input/output
3--SKIPIF--
4<?php
5    ini_set('include_path', __DIR__);
6    extension_loaded('mbstring') or die('skip mbstring not available');
7?>
8--INI--
9output_buffering=4096
10output_handler=mb_output_handler
11zlib.output_compression=
12arg_separator.input=x
13error_reporting=0
14input_encoding=HTML-ENTITIES
15output_encoding=HTML-ENTITIES
16mbstring.encoding_translation=1
17filter.default=unsafe_raw
18--FILE--
19<?php
20// enable output encoding through output handler
21//ob_start("mb_output_handler");
22// &#64... are must be decoded on input these are not reencoded on output.
23// If you see &#64;&#65;&#66; on output this means input encoding fails.
24// If you do not see &auml;... on output this means output encoding fails.
25// Using UTF-8 internally allows to encode/decode ALL characters.
26// &128... will stay as they are since their character codes are above 127
27// and they do not have a named entity representation.
28?>
29<?php echo mb_http_input('l').'>'.mb_internal_encoding().'>'.mb_http_output();?>
30
31<?php mb_parse_str("test=&#38;&#64;&#65;&#66;&#128;&#129;&#130;&auml;&ouml;&uuml;&euro;&lang;&rang;", $test);
32print_r($test);
33?>
34--EXPECT--
35HTML-ENTITIES>UTF-8>HTML-ENTITIES
36Array
37(
38    [test] => &@AB&#128;&#129;&#130;&auml;&ouml;&uuml;&euro;&lang;&rang;
39)
40