Annotation of embedaddon/php/ext/standard/tests/strings/htmlentities-utf-2.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: HTML entities with invalid chars and ENT_IGNORE
3: --INI--
4: output_handler=
5: --FILE--
6: <?php
7: @setlocale (LC_CTYPE, "C");
8: $strings = array(b"<", b"\xD0", b"\xD0\x90", b"\xD0\x90\xD0", b"\xD0\x90\xD0\xB0", b"\xE0", b"A\xE0", b"\xE0\x80", b"\xE0\x79", b"\xE0\x80\xBE",
9: b"Voil\xE0", b"Clich\xE9s",
10: b"\xFE", b"\xFE\x41", b"\xC3\xA9", b"\xC3\x79", b"\xF7\xBF\xBF\xBF", b"\xFB\xBF\xBF\xBF\xBF", b"\xFD\xBF\xBF\xBF\xBF\xBF",
11: b"\x41\xF7\xF7\x42", b"\x42\xFB\xFB\x42", b"\x43\xFD\xFD\x42", b"\x44\xF7\xF7", b"\x45\xFB\xFB", b"\x46\xFD\xFD"
12: );
13: foreach($strings as $string) {
14: $sc_encoded = htmlspecialchars ($string, ENT_QUOTES | ENT_IGNORE, "utf-8");
15: var_dump(bin2hex($sc_encoded));
16: $ent_encoded = htmlentities ($string, ENT_QUOTES | ENT_IGNORE, "utf-8");
17: var_dump(bin2hex($ent_encoded));
18: }
19: ?>
20: --EXPECTF--
21: %unicode|string%(8) "266c743b"
22: %unicode|string%(8) "266c743b"
23: %unicode|string%(0) ""
24: %unicode|string%(0) ""
25: %unicode|string%(4) "d090"
26: %unicode|string%(4) "d090"
27: %unicode|string%(4) "d090"
28: %unicode|string%(4) "d090"
29: %unicode|string%(8) "d090d0b0"
30: %unicode|string%(8) "d090d0b0"
31: %unicode|string%(0) ""
32: %unicode|string%(0) ""
33: %unicode|string%(2) "41"
34: %unicode|string%(2) "41"
35: %unicode|string%(0) ""
36: %unicode|string%(0) ""
37: %unicode|string%(2) "79"
38: %unicode|string%(2) "79"
39: %unicode|string%(0) ""
40: %unicode|string%(0) ""
41: %unicode|string%(8) "566f696c"
42: %unicode|string%(8) "566f696c"
43: %unicode|string%(12) "436c69636873"
44: %unicode|string%(12) "436c69636873"
45: %unicode|string%(0) ""
46: %unicode|string%(0) ""
47: %unicode|string%(2) "41"
48: %unicode|string%(2) "41"
49: %unicode|string%(4) "c3a9"
50: %unicode|string%(16) "266561637574653b"
51: %unicode|string%(2) "79"
52: %unicode|string%(2) "79"
53: %unicode|string%(0) ""
54: %unicode|string%(0) ""
55: %unicode|string%(0) ""
56: %unicode|string%(0) ""
57: %unicode|string%(0) ""
58: %unicode|string%(0) ""
59: %unicode|string%(4) "4142"
60: %unicode|string%(4) "4142"
61: %unicode|string%(4) "4242"
62: %unicode|string%(4) "4242"
63: %unicode|string%(4) "4342"
64: %unicode|string%(4) "4342"
65: %unicode|string%(2) "44"
66: %unicode|string%(2) "44"
67: %unicode|string%(2) "45"
68: %unicode|string%(2) "45"
69: %unicode|string%(2) "46"
70: %unicode|string%(2) "46"
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>