enable coroutine for rust emitter
[hiphop-php.git] / hphp / test / slow / utf8_decode-invalid.php
blob85f528cd2b9fa20e42e2290fba298ea8b95fbc33
1 <?hh
4 // https://github.com/facebook/hhvm/issues/5010
5 // utf8_decode() targets latin1, therefore any character
6 // greater than U+00FF should come out as
7 // U+003F QUESTION MARK
9 // U+00DF LATIN SMALL LETTER SHARP S
10 <<__EntryPoint>>
11 function main_utf8_decode_invalid() {
12 $ss = "\u{DF}";
13 var_dump(urlencode($ss));
14 var_dump(urlencode(utf8_decode($ss)));
15 var_dump(json_encode(utf8_decode($ss)));
17 // U+044F CYRILLIC SMALL LETTER YA
18 $ya = "\u{44F}";
19 var_dump(urlencode($ya));
20 var_dump(urlencode(utf8_decode($ya)));
21 var_dump(json_encode(utf8_decode($ya)));
23 // Improperly formatted U+0041 LATIN CAPITAL LETTER A
24 $A = "\xC1\x81";
25 var_dump(urlencode($A));
26 var_dump(urlencode(utf8_decode($A)));
27 var_dump(json_encode(utf8_decode($A)));