1--TEST--
2Test get_html_translation_table() function : basic functionality - charset WINDOWS-1252
3--FILE--
4<?php
5/* Prototype  : array get_html_translation_table ( [int $table [, int $quote_style [, string charset_hint]]] )
6 * Description: Returns the internal translation table used by htmlspecialchars and htmlentities
7 * Source code: ext/standard/html.c
8*/
9
10
11echo "*** Testing get_html_translation_table() : basic functionality/Windows-1252 ***\n";
12
13echo "-- with table = HTML_ENTITIES --\n";
14$table = HTML_ENTITIES;
15var_dump( get_html_translation_table($table, ENT_COMPAT, "WINDOWS-1252") );
16
17echo "-- with table = HTML_SPECIALCHARS --\n";
18$table = HTML_SPECIALCHARS;
19var_dump( get_html_translation_table($table, ENT_COMPAT, "WINDOWS-1252") );
20
21echo "Done\n";
22?>
23--EXPECTF--
24*** Testing get_html_translation_table() : basic functionality/Windows-1252 ***
25-- with table = HTML_ENTITIES --
26array(125) {
27  ["�"]=>
28  string(6) "&euro;"
29  ["�"]=>
30  string(7) "&sbquo;"
31  ["�"]=>
32  string(6) "&fnof;"
33  ["�"]=>
34  string(7) "&bdquo;"
35  ["�"]=>
36  string(8) "&hellip;"
37  ["�"]=>
38  string(8) "&dagger;"
39  ["�"]=>
40  string(8) "&Dagger;"
41  ["�"]=>
42  string(6) "&circ;"
43  ["�"]=>
44  string(8) "&permil;"
45  ["�"]=>
46  string(8) "&Scaron;"
47  ["�"]=>
48  string(8) "&lsaquo;"
49  ["�"]=>
50  string(7) "&OElig;"
51  ["�"]=>
52  string(7) "&lsquo;"
53  ["�"]=>
54  string(7) "&rsquo;"
55  ["�"]=>
56  string(7) "&ldquo;"
57  ["�"]=>
58  string(7) "&rdquo;"
59  ["�"]=>
60  string(6) "&bull;"
61  ["�"]=>
62  string(7) "&ndash;"
63  ["�"]=>
64  string(7) "&mdash;"
65  ["�"]=>
66  string(7) "&tilde;"
67  ["�"]=>
68  string(7) "&trade;"
69  ["�"]=>
70  string(8) "&scaron;"
71  ["�"]=>
72  string(8) "&rsaquo;"
73  ["�"]=>
74  string(7) "&oelig;"
75  ["�"]=>
76  string(6) "&Yuml;"
77  ["�"]=>
78  string(6) "&nbsp;"
79  ["�"]=>
80  string(7) "&iexcl;"
81  ["�"]=>
82  string(6) "&cent;"
83  ["�"]=>
84  string(7) "&pound;"
85  ["�"]=>
86  string(8) "&curren;"
87  ["�"]=>
88  string(5) "&yen;"
89  ["�"]=>
90  string(8) "&brvbar;"
91  ["�"]=>
92  string(6) "&sect;"
93  ["�"]=>
94  string(5) "&uml;"
95  ["�"]=>
96  string(6) "&copy;"
97  ["�"]=>
98  string(6) "&ordf;"
99  ["�"]=>
100  string(7) "&laquo;"
101  ["�"]=>
102  string(5) "&not;"
103  ["�"]=>
104  string(5) "&shy;"
105  ["�"]=>
106  string(5) "&reg;"
107  ["�"]=>
108  string(6) "&macr;"
109  ["�"]=>
110  string(5) "&deg;"
111  ["�"]=>
112  string(8) "&plusmn;"
113  ["�"]=>
114  string(6) "&sup2;"
115  ["�"]=>
116  string(6) "&sup3;"
117  ["�"]=>
118  string(7) "&acute;"
119  ["�"]=>
120  string(7) "&micro;"
121  ["�"]=>
122  string(6) "&para;"
123  ["�"]=>
124  string(8) "&middot;"
125  ["�"]=>
126  string(7) "&cedil;"
127  ["�"]=>
128  string(6) "&sup1;"
129  ["�"]=>
130  string(6) "&ordm;"
131  ["�"]=>
132  string(7) "&raquo;"
133  ["�"]=>
134  string(8) "&frac14;"
135  ["�"]=>
136  string(8) "&frac12;"
137  ["�"]=>
138  string(8) "&frac34;"
139  ["�"]=>
140  string(8) "&iquest;"
141  ["�"]=>
142  string(8) "&Agrave;"
143  ["�"]=>
144  string(8) "&Aacute;"
145  ["�"]=>
146  string(7) "&Acirc;"
147  ["�"]=>
148  string(8) "&Atilde;"
149  ["�"]=>
150  string(6) "&Auml;"
151  ["�"]=>
152  string(7) "&Aring;"
153  ["�"]=>
154  string(7) "&AElig;"
155  ["�"]=>
156  string(8) "&Ccedil;"
157  ["�"]=>
158  string(8) "&Egrave;"
159  ["�"]=>
160  string(8) "&Eacute;"
161  ["�"]=>
162  string(7) "&Ecirc;"
163  ["�"]=>
164  string(6) "&Euml;"
165  ["�"]=>
166  string(8) "&Igrave;"
167  ["�"]=>
168  string(8) "&Iacute;"
169  ["�"]=>
170  string(7) "&Icirc;"
171  ["�"]=>
172  string(6) "&Iuml;"
173  ["�"]=>
174  string(5) "&ETH;"
175  ["�"]=>
176  string(8) "&Ntilde;"
177  ["�"]=>
178  string(8) "&Ograve;"
179  ["�"]=>
180  string(8) "&Oacute;"
181  ["�"]=>
182  string(7) "&Ocirc;"
183  ["�"]=>
184  string(8) "&Otilde;"
185  ["�"]=>
186  string(6) "&Ouml;"
187  ["�"]=>
188  string(7) "&times;"
189  ["�"]=>
190  string(8) "&Oslash;"
191  ["�"]=>
192  string(8) "&Ugrave;"
193  ["�"]=>
194  string(8) "&Uacute;"
195  ["�"]=>
196  string(7) "&Ucirc;"
197  ["�"]=>
198  string(6) "&Uuml;"
199  ["�"]=>
200  string(8) "&Yacute;"
201  ["�"]=>
202  string(7) "&THORN;"
203  ["�"]=>
204  string(7) "&szlig;"
205  ["�"]=>
206  string(8) "&agrave;"
207  ["�"]=>
208  string(8) "&aacute;"
209  ["�"]=>
210  string(7) "&acirc;"
211  ["�"]=>
212  string(8) "&atilde;"
213  ["�"]=>
214  string(6) "&auml;"
215  ["�"]=>
216  string(7) "&aring;"
217  ["�"]=>
218  string(7) "&aelig;"
219  ["�"]=>
220  string(8) "&ccedil;"
221  ["�"]=>
222  string(8) "&egrave;"
223  ["�"]=>
224  string(8) "&eacute;"
225  ["�"]=>
226  string(7) "&ecirc;"
227  ["�"]=>
228  string(6) "&euml;"
229  ["�"]=>
230  string(8) "&igrave;"
231  ["�"]=>
232  string(8) "&iacute;"
233  ["�"]=>
234  string(7) "&icirc;"
235  ["�"]=>
236  string(6) "&iuml;"
237  ["�"]=>
238  string(5) "&eth;"
239  ["�"]=>
240  string(8) "&ntilde;"
241  ["�"]=>
242  string(8) "&ograve;"
243  ["�"]=>
244  string(8) "&oacute;"
245  ["�"]=>
246  string(7) "&ocirc;"
247  ["�"]=>
248  string(8) "&otilde;"
249  ["�"]=>
250  string(6) "&ouml;"
251  ["�"]=>
252  string(8) "&divide;"
253  ["�"]=>
254  string(8) "&oslash;"
255  ["�"]=>
256  string(8) "&ugrave;"
257  ["�"]=>
258  string(8) "&uacute;"
259  ["�"]=>
260  string(7) "&ucirc;"
261  ["�"]=>
262  string(6) "&uuml;"
263  ["�"]=>
264  string(8) "&yacute;"
265  ["�"]=>
266  string(7) "&thorn;"
267  ["�"]=>
268  string(6) "&yuml;"
269  ["&"]=>
270  string(5) "&amp;"
271  ["""]=>
272  string(6) "&quot;"
273  ["<"]=>
274  string(4) "&lt;"
275  [">"]=>
276  string(4) "&gt;"
277}
278-- with table = HTML_SPECIALCHARS --
279array(4) {
280  ["&"]=>
281  string(5) "&amp;"
282  ["""]=>
283  string(6) "&quot;"
284  ["<"]=>
285  string(4) "&lt;"
286  [">"]=>
287  string(4) "&gt;"
288}
289Done
290