Annotation of embedaddon/php/ext/standard/tests/strings/htmlentities-utf.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: HTML entities with invalid chars
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, "utf-8");
15: var_dump(bin2hex($sc_encoded));
16: $ent_encoded = htmlentities ($string, ENT_QUOTES, "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%(0) ""
28: %unicode|string%(0) ""
29: %unicode|string%(8) "d090d0b0"
30: %unicode|string%(8) "d090d0b0"
31: %unicode|string%(0) ""
32: %unicode|string%(0) ""
33: %unicode|string%(0) ""
34: %unicode|string%(0) ""
35: %unicode|string%(0) ""
36: %unicode|string%(0) ""
37: %unicode|string%(0) ""
38: %unicode|string%(0) ""
39: %unicode|string%(0) ""
40: %unicode|string%(0) ""
41: %unicode|string%(0) ""
42: %unicode|string%(0) ""
43: %unicode|string%(0) ""
44: %unicode|string%(0) ""
45: %unicode|string%(0) ""
46: %unicode|string%(0) ""
47: %unicode|string%(0) ""
48: %unicode|string%(0) ""
49: %unicode|string%(4) "c3a9"
50: %unicode|string%(16) "266561637574653b"
51: %unicode|string%(0) ""
52: %unicode|string%(0) ""
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%(0) ""
60: %unicode|string%(0) ""
61: %unicode|string%(0) ""
62: %unicode|string%(0) ""
63: %unicode|string%(0) ""
64: %unicode|string%(0) ""
65: %unicode|string%(0) ""
66: %unicode|string%(0) ""
67: %unicode|string%(0) ""
68: %unicode|string%(0) ""
69: %unicode|string%(0) ""
70: %unicode|string%(0) ""
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>