--TEST--
Translation of HTML entities for encoding CP866
--FILE--
array(0x80, "CYRILLIC CAPITAL LETTER A"),
0x0411 => array(0x81, "CYRILLIC CAPITAL LETTER BE"),
0x0412 => array(0x82, "CYRILLIC CAPITAL LETTER VE"),
0x0413 => array(0x83, "CYRILLIC CAPITAL LETTER GHE"),
0x0414 => array(0x84, "CYRILLIC CAPITAL LETTER DE"),
0x0415 => array(0x85, "CYRILLIC CAPITAL LETTER IE"),
0x0416 => array(0x86, "CYRILLIC CAPITAL LETTER ZHE"),
0x0417 => array(0x87, "CYRILLIC CAPITAL LETTER ZE"),
0x0418 => array(0x88, "CYRILLIC CAPITAL LETTER I"),
0x0419 => array(0x89, "CYRILLIC CAPITAL LETTER SHORT I"),
0x041a => array(0x8a, "CYRILLIC CAPITAL LETTER KA"),
0x041b => array(0x8b, "CYRILLIC CAPITAL LETTER EL"),
0x041c => array(0x8c, "CYRILLIC CAPITAL LETTER EM"),
0x041d => array(0x8d, "CYRILLIC CAPITAL LETTER EN"),
0x041e => array(0x8e, "CYRILLIC CAPITAL LETTER O"),
0x041f => array(0x8f, "CYRILLIC CAPITAL LETTER PE"),
0x0420 => array(0x90, "CYRILLIC CAPITAL LETTER ER"),
0x0421 => array(0x91, "CYRILLIC CAPITAL LETTER ES"),
0x0422 => array(0x92, "CYRILLIC CAPITAL LETTER TE"),
0x0423 => array(0x93, "CYRILLIC CAPITAL LETTER U"),
0x0424 => array(0x94, "CYRILLIC CAPITAL LETTER EF"),
0x0425 => array(0x95, "CYRILLIC CAPITAL LETTER HA"),
0x0426 => array(0x96, "CYRILLIC CAPITAL LETTER TSE"),
0x0427 => array(0x97, "CYRILLIC CAPITAL LETTER CHE"),
0x0428 => array(0x98, "CYRILLIC CAPITAL LETTER SHA"),
0x0429 => array(0x99, "CYRILLIC CAPITAL LETTER SHCHA"),
0x042a => array(0x9a, "CYRILLIC CAPITAL LETTER HARD SIGN"),
0x042b => array(0x9b, "CYRILLIC CAPITAL LETTER YERU"),
0x042c => array(0x9c, "CYRILLIC CAPITAL LETTER SOFT SIGN"),
0x042d => array(0x9d, "CYRILLIC CAPITAL LETTER E"),
0x042e => array(0x9e, "CYRILLIC CAPITAL LETTER YU"),
0x042f => array(0x9f, "CYRILLIC CAPITAL LETTER YA"),
0x0430 => array(0xa0, "CYRILLIC SMALL LETTER A"),
0x0431 => array(0xa1, "CYRILLIC SMALL LETTER BE"),
0x0432 => array(0xa2, "CYRILLIC SMALL LETTER VE"),
0x0433 => array(0xa3, "CYRILLIC SMALL LETTER GHE"),
0x0434 => array(0xa4, "CYRILLIC SMALL LETTER DE"),
0x0435 => array(0xa5, "CYRILLIC SMALL LETTER IE"),
0x0436 => array(0xa6, "CYRILLIC SMALL LETTER ZHE"),
0x0437 => array(0xa7, "CYRILLIC SMALL LETTER ZE"),
0x0438 => array(0xa8, "CYRILLIC SMALL LETTER I"),
0x0439 => array(0xa9, "CYRILLIC SMALL LETTER SHORT I"),
0x043a => array(0xaa, "CYRILLIC SMALL LETTER KA"),
0x043b => array(0xab, "CYRILLIC SMALL LETTER EL"),
0x043c => array(0xac, "CYRILLIC SMALL LETTER EM"),
0x043d => array(0xad, "CYRILLIC SMALL LETTER EN"),
0x043e => array(0xae, "CYRILLIC SMALL LETTER O"),
0x043f => array(0xaf, "CYRILLIC SMALL LETTER PE"),
0x2591 => array(0xb0, "LIGHT SHADE"),
0x2592 => array(0xb1, "MEDIUM SHADE"),
0x2593 => array(0xb2, "DARK SHADE"),
0x2502 => array(0xb3, "BOX DRAWINGS LIGHT VERTICAL"),
0x2524 => array(0xb4, "BOX DRAWINGS LIGHT VERTICAL AND LEFT"),
0x2561 => array(0xb5, "BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE"),
0x2562 => array(0xb6, "BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE"),
0x2556 => array(0xb7, "BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE"),
0x2555 => array(0xb8, "BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE"),
0x2563 => array(0xb9, "BOX DRAWINGS DOUBLE VERTICAL AND LEFT"),
0x2551 => array(0xba, "BOX DRAWINGS DOUBLE VERTICAL"),
0x2557 => array(0xbb, "BOX DRAWINGS DOUBLE DOWN AND LEFT"),
0x255d => array(0xbc, "BOX DRAWINGS DOUBLE UP AND LEFT"),
0x255c => array(0xbd, "BOX DRAWINGS UP DOUBLE AND LEFT SINGLE"),
0x255b => array(0xbe, "BOX DRAWINGS UP SINGLE AND LEFT DOUBLE"),
0x2510 => array(0xbf, "BOX DRAWINGS LIGHT DOWN AND LEFT"),
0x2514 => array(0xc0, "BOX DRAWINGS LIGHT UP AND RIGHT"),
0x2534 => array(0xc1, "BOX DRAWINGS LIGHT UP AND HORIZONTAL"),
0x252c => array(0xc2, "BOX DRAWINGS LIGHT DOWN AND HORIZONTAL"),
0x251c => array(0xc3, "BOX DRAWINGS LIGHT VERTICAL AND RIGHT"),
0x2500 => array(0xc4, "BOX DRAWINGS LIGHT HORIZONTAL"),
0x253c => array(0xc5, "BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL"),
0x255e => array(0xc6, "BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE"),
0x255f => array(0xc7, "BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE"),
0x255a => array(0xc8, "BOX DRAWINGS DOUBLE UP AND RIGHT"),
0x2554 => array(0xc9, "BOX DRAWINGS DOUBLE DOWN AND RIGHT"),
0x2569 => array(0xca, "BOX DRAWINGS DOUBLE UP AND HORIZONTAL"),
0x2566 => array(0xcb, "BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL"),
0x2560 => array(0xcc, "BOX DRAWINGS DOUBLE VERTICAL AND RIGHT"),
0x2550 => array(0xcd, "BOX DRAWINGS DOUBLE HORIZONTAL"),
0x256c => array(0xce, "BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL"),
0x2567 => array(0xcf, "BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE"),
0x2568 => array(0xd0, "BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE"),
0x2564 => array(0xd1, "BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE"),
0x2565 => array(0xd2, "BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE"),
0x2559 => array(0xd3, "BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE"),
0x2558 => array(0xd4, "BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE"),
0x2552 => array(0xd5, "BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE"),
0x2553 => array(0xd6, "BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE"),
0x256b => array(0xd7, "BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE"),
0x256a => array(0xd8, "BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE"),
0x2518 => array(0xd9, "BOX DRAWINGS LIGHT UP AND LEFT"),
0x250c => array(0xda, "BOX DRAWINGS LIGHT DOWN AND RIGHT"),
0x2588 => array(0xdb, "FULL BLOCK"),
0x2584 => array(0xdc, "LOWER HALF BLOCK"),
0x258c => array(0xdd, "LEFT HALF BLOCK"),
0x2590 => array(0xde, "RIGHT HALF BLOCK"),
0x2580 => array(0xdf, "UPPER HALF BLOCK"),
0x0440 => array(0xe0, "CYRILLIC SMALL LETTER ER"),
0x0441 => array(0xe1, "CYRILLIC SMALL LETTER ES"),
0x0442 => array(0xe2, "CYRILLIC SMALL LETTER TE"),
0x0443 => array(0xe3, "CYRILLIC SMALL LETTER U"),
0x0444 => array(0xe4, "CYRILLIC SMALL LETTER EF"),
0x0445 => array(0xe5, "CYRILLIC SMALL LETTER HA"),
0x0446 => array(0xe6, "CYRILLIC SMALL LETTER TSE"),
0x0447 => array(0xe7, "CYRILLIC SMALL LETTER CHE"),
0x0448 => array(0xe8, "CYRILLIC SMALL LETTER SHA"),
0x0449 => array(0xe9, "CYRILLIC SMALL LETTER SHCHA"),
0x044a => array(0xea, "CYRILLIC SMALL LETTER HARD SIGN"),
0x044b => array(0xeb, "CYRILLIC SMALL LETTER YERU"),
0x044c => array(0xec, "CYRILLIC SMALL LETTER SOFT SIGN"),
0x044d => array(0xed, "CYRILLIC SMALL LETTER E"),
0x044e => array(0xee, "CYRILLIC SMALL LETTER YU"),
0x044f => array(0xef, "CYRILLIC SMALL LETTER YA"),
0x0401 => array(0xf0, "CYRILLIC CAPITAL LETTER IO"),
0x0451 => array(0xf1, "CYRILLIC SMALL LETTER IO"),
0x0404 => array(0xf2, "CYRILLIC CAPITAL LETTER UKRAINIAN IE"),
0x0454 => array(0xf3, "CYRILLIC SMALL LETTER UKRAINIAN IE"),
0x0407 => array(0xf4, "CYRILLIC CAPITAL LETTER YI"),
0x0457 => array(0xf5, "CYRILLIC SMALL LETTER YI"),
0x040e => array(0xf6, "CYRILLIC CAPITAL LETTER SHORT U"),
0x045e => array(0xf7, "CYRILLIC SMALL LETTER SHORT U"),
0x00b0 => array(0xf8, "DEGREE SIGN"),
0x2219 => array(0xf9, "BULLET OPERATOR"),
0x00b7 => array(0xfa, "MIDDLE DOT"),
0x221a => array(0xfb, "SQUARE ROOT"),
0x2116 => array(0xfc, "NUMERO SIGN"),
0x00a4 => array(0xfd, "CURRENCY SIGN"),
0x25a0 => array(0xfe, "BLACK SQUARE"),
0x00a0 => array(0xff, "NO-BREAK SPACE"),
);
foreach ($arr as $u => $v) {
$ent = sprintf("%X;", $u);
$res = html_entity_decode($ent, ENT_QUOTES, 'CP866');
$d = unpack("H*", $res);
echo sprintf("%s: %s => %s\n", $v[1], $ent, $d[1]);
$ent = sprintf("%X;", $v[0]);
$res = html_entity_decode($ent, ENT_QUOTES, 'CP866');
if ($res[0] != "&" || $res[1] != "#")
$res = unpack("H*", $res)[1];
echo sprintf("%s => %s\n\n", $ent, $res);
}
?>
--EXPECT--
CYRILLIC CAPITAL LETTER A: А => 80
=>
CYRILLIC CAPITAL LETTER BE: Б => 81
=>
CYRILLIC CAPITAL LETTER VE: В => 82
=>
CYRILLIC CAPITAL LETTER GHE: Г => 83
=>
CYRILLIC CAPITAL LETTER DE: Д => 84
=>
CYRILLIC CAPITAL LETTER IE: Е => 85
=>
CYRILLIC CAPITAL LETTER ZHE: Ж => 86
=>
CYRILLIC CAPITAL LETTER ZE: З => 87
=>
CYRILLIC CAPITAL LETTER I: И => 88
=>
CYRILLIC CAPITAL LETTER SHORT I: Й => 89
=>
CYRILLIC CAPITAL LETTER KA: К => 8a
=>
CYRILLIC CAPITAL LETTER EL: Л => 8b
=>
CYRILLIC CAPITAL LETTER EM: М => 8c
=>
CYRILLIC CAPITAL LETTER EN: Н => 8d
=>
CYRILLIC CAPITAL LETTER O: О => 8e
=>
CYRILLIC CAPITAL LETTER PE: П => 8f
=>
CYRILLIC CAPITAL LETTER ER: Р => 90
=>
CYRILLIC CAPITAL LETTER ES: С => 91
=>
CYRILLIC CAPITAL LETTER TE: Т => 92
=>
CYRILLIC CAPITAL LETTER U: У => 93
=>
CYRILLIC CAPITAL LETTER EF: Ф => 94
=>
CYRILLIC CAPITAL LETTER HA: Х => 95
=>
CYRILLIC CAPITAL LETTER TSE: Ц => 96
=>
CYRILLIC CAPITAL LETTER CHE: Ч => 97
=>
CYRILLIC CAPITAL LETTER SHA: Ш => 98
=>
CYRILLIC CAPITAL LETTER SHCHA: Щ => 99
=>
CYRILLIC CAPITAL LETTER HARD SIGN: Ъ => 9a
=>
CYRILLIC CAPITAL LETTER YERU: Ы => 9b
=>
CYRILLIC CAPITAL LETTER SOFT SIGN: Ь => 9c
=>
CYRILLIC CAPITAL LETTER E: Э => 9d
=>
CYRILLIC CAPITAL LETTER YU: Ю => 9e
=>
CYRILLIC CAPITAL LETTER YA: Я => 9f
=>
CYRILLIC SMALL LETTER A: а => a0
=> ff
CYRILLIC SMALL LETTER BE: б => a1
¡ => ¡
CYRILLIC SMALL LETTER VE: в => a2
¢ => ¢
CYRILLIC SMALL LETTER GHE: г => a3
£ => £
CYRILLIC SMALL LETTER DE: д => a4
¤ => fd
CYRILLIC SMALL LETTER IE: е => a5
¥ => ¥
CYRILLIC SMALL LETTER ZHE: ж => a6
¦ => ¦
CYRILLIC SMALL LETTER ZE: з => a7
§ => §
CYRILLIC SMALL LETTER I: и => a8
¨ => ¨
CYRILLIC SMALL LETTER SHORT I: й => a9
© => ©
CYRILLIC SMALL LETTER KA: к => aa
ª => ª
CYRILLIC SMALL LETTER EL: л => ab
« => «
CYRILLIC SMALL LETTER EM: м => ac
¬ => ¬
CYRILLIC SMALL LETTER EN: н => ad
=>
CYRILLIC SMALL LETTER O: о => ae
® => ®
CYRILLIC SMALL LETTER PE: п => af
¯ => ¯
LIGHT SHADE: ░ => b0
° => f8
MEDIUM SHADE: ▒ => b1
± => ±
DARK SHADE: ▓ => b2
² => ²
BOX DRAWINGS LIGHT VERTICAL: │ => b3
³ => ³
BOX DRAWINGS LIGHT VERTICAL AND LEFT: ┤ => b4
´ => ´
BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE: ╡ => b5
µ => µ
BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE: ╢ => b6
¶ => ¶
BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE: ╖ => b7
· => fa
BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE: ╕ => b8
¸ => ¸
BOX DRAWINGS DOUBLE VERTICAL AND LEFT: ╣ => b9
¹ => ¹
BOX DRAWINGS DOUBLE VERTICAL: ║ => ba
º => º
BOX DRAWINGS DOUBLE DOWN AND LEFT: ╗ => bb
» => »
BOX DRAWINGS DOUBLE UP AND LEFT: ╝ => bc
¼ => ¼
BOX DRAWINGS UP DOUBLE AND LEFT SINGLE: ╜ => bd
½ => ½
BOX DRAWINGS UP SINGLE AND LEFT DOUBLE: ╛ => be
¾ => ¾
BOX DRAWINGS LIGHT DOWN AND LEFT: ┐ => bf
¿ => ¿
BOX DRAWINGS LIGHT UP AND RIGHT: └ => c0
À => À
BOX DRAWINGS LIGHT UP AND HORIZONTAL: ┴ => c1
Á => Á
BOX DRAWINGS LIGHT DOWN AND HORIZONTAL: ┬ => c2
 => Â
BOX DRAWINGS LIGHT VERTICAL AND RIGHT: ├ => c3
à => Ã
BOX DRAWINGS LIGHT HORIZONTAL: ─ => c4
Ä => Ä
BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL: ┼ => c5
Å => Å
BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE: ╞ => c6
Æ => Æ
BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE: ╟ => c7
Ç => Ç
BOX DRAWINGS DOUBLE UP AND RIGHT: ╚ => c8
È => È
BOX DRAWINGS DOUBLE DOWN AND RIGHT: ╔ => c9
É => É
BOX DRAWINGS DOUBLE UP AND HORIZONTAL: ╩ => ca
Ê => Ê
BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL: ╦ => cb
Ë => Ë
BOX DRAWINGS DOUBLE VERTICAL AND RIGHT: ╠ => cc
Ì => Ì
BOX DRAWINGS DOUBLE HORIZONTAL: ═ => cd
Í => Í
BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL: ╬ => ce
Î => Î
BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE: ╧ => cf
Ï => Ï
BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE: ╨ => d0
Ð => Ð
BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE: ╤ => d1
Ñ => Ñ
BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE: ╥ => d2
Ò => Ò
BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE: ╙ => d3
Ó => Ó
BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE: ╘ => d4
Ô => Ô
BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE: ╒ => d5
Õ => Õ
BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE: ╓ => d6
Ö => Ö
BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE: ╫ => d7
× => ×
BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE: ╪ => d8
Ø => Ø
BOX DRAWINGS LIGHT UP AND LEFT: ┘ => d9
Ù => Ù
BOX DRAWINGS LIGHT DOWN AND RIGHT: ┌ => da
Ú => Ú
FULL BLOCK: █ => db
Û => Û
LOWER HALF BLOCK: ▄ => dc
Ü => Ü
LEFT HALF BLOCK: ▌ => dd
Ý => Ý
RIGHT HALF BLOCK: ▐ => de
Þ => Þ
UPPER HALF BLOCK: ▀ => df
ß => ß
CYRILLIC SMALL LETTER ER: р => e0
à => à
CYRILLIC SMALL LETTER ES: с => e1
á => á
CYRILLIC SMALL LETTER TE: т => e2
â => â
CYRILLIC SMALL LETTER U: у => e3
ã => ã
CYRILLIC SMALL LETTER EF: ф => e4
ä => ä
CYRILLIC SMALL LETTER HA: х => e5
å => å
CYRILLIC SMALL LETTER TSE: ц => e6
æ => æ
CYRILLIC SMALL LETTER CHE: ч => e7
ç => ç
CYRILLIC SMALL LETTER SHA: ш => e8
è => è
CYRILLIC SMALL LETTER SHCHA: щ => e9
é => é
CYRILLIC SMALL LETTER HARD SIGN: ъ => ea
ê => ê
CYRILLIC SMALL LETTER YERU: ы => eb
ë => ë
CYRILLIC SMALL LETTER SOFT SIGN: ь => ec
ì => ì
CYRILLIC SMALL LETTER E: э => ed
í => í
CYRILLIC SMALL LETTER YU: ю => ee
î => î
CYRILLIC SMALL LETTER YA: я => ef
ï => ï
CYRILLIC CAPITAL LETTER IO: Ё => f0
ð => ð
CYRILLIC SMALL LETTER IO: ё => f1
ñ => ñ
CYRILLIC CAPITAL LETTER UKRAINIAN IE: Є => f2
ò => ò
CYRILLIC SMALL LETTER UKRAINIAN IE: є => f3
ó => ó
CYRILLIC CAPITAL LETTER YI: Ї => f4
ô => ô
CYRILLIC SMALL LETTER YI: ї => f5
õ => õ
CYRILLIC CAPITAL LETTER SHORT U: Ў => f6
ö => ö
CYRILLIC SMALL LETTER SHORT U: ў => f7
÷ => ÷
DEGREE SIGN: ° => f8
ø => ø
BULLET OPERATOR: ∙ => f9
ù => ù
MIDDLE DOT: · => fa
ú => ú
SQUARE ROOT: √ => fb
û => û
NUMERO SIGN: № => fc
ü => ü
CURRENCY SIGN: ¤ => fd
ý => ý
BLACK SQUARE: ■ => fe
þ => þ
NO-BREAK SPACE: => ff
ÿ => ÿ