--TEST--
Translation of HTML entities for encoding KOI8-R
--FILE--
array(0x80, "BOX DRAWINGS LIGHT HORIZONTAL"),
0x2502 => array(0x81, "BOX DRAWINGS LIGHT VERTICAL"),
0x250C => array(0x82, "BOX DRAWINGS LIGHT DOWN AND RIGHT"),
0x2510 => array(0x83, "BOX DRAWINGS LIGHT DOWN AND LEFT"),
0x2514 => array(0x84, "BOX DRAWINGS LIGHT UP AND RIGHT"),
0x2518 => array(0x85, "BOX DRAWINGS LIGHT UP AND LEFT"),
0x251C => array(0x86, "BOX DRAWINGS LIGHT VERTICAL AND RIGHT"),
0x2524 => array(0x87, "BOX DRAWINGS LIGHT VERTICAL AND LEFT"),
0x252C => array(0x88, "BOX DRAWINGS LIGHT DOWN AND HORIZONTAL"),
0x2534 => array(0x89, "BOX DRAWINGS LIGHT UP AND HORIZONTAL"),
0x253C => array(0x8A, "BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL"),
0x2580 => array(0x8B, "UPPER HALF BLOCK"),
0x2584 => array(0x8C, "LOWER HALF BLOCK"),
0x2588 => array(0x8D, "FULL BLOCK"),
0x258C => array(0x8E, "LEFT HALF BLOCK"),
0x2590 => array(0x8F, "RIGHT HALF BLOCK"),
0x2591 => array(0x90, "LIGHT SHADE"),
0x2592 => array(0x91, "MEDIUM SHADE"),
0x2593 => array(0x92, "DARK SHADE"),
0x2320 => array(0x93, "TOP HALF INTEGRAL"),
0x25A0 => array(0x94, "BLACK SQUARE"),
0x2219 => array(0x95, "BULLET OPERATOR"),
0x221A => array(0x96, "SQUARE ROOT"),
0x2248 => array(0x97, "ALMOST EQUAL TO"),
0x2264 => array(0x98, "LESS-THAN OR EQUAL TO"),
0x2265 => array(0x99, "GREATER-THAN OR EQUAL TO"),
0x00A0 => array(0x9A, "NO-BREAK SPACE"),
0x2321 => array(0x9B, "BOTTOM HALF INTEGRAL"),
0x00B0 => array(0x9C, "DEGREE SIGN"),
0x00B2 => array(0x9D, "SUPERSCRIPT TWO"),
0x00B7 => array(0x9E, "MIDDLE DOT"),
0x00F7 => array(0x9F, "DIVISION SIGN"),
0x2550 => array(0xA0, "BOX DRAWINGS DOUBLE HORIZONTAL"),
0x2551 => array(0xA1, "BOX DRAWINGS DOUBLE VERTICAL"),
0x2552 => array(0xA2, "BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE"),
0x0451 => array(0xA3, "CYRILLIC SMALL LETTER IO"),
0x2553 => array(0xA4, "BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE"),
0x2554 => array(0xA5, "BOX DRAWINGS DOUBLE DOWN AND RIGHT"),
0x2555 => array(0xA6, "BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE"),
0x2556 => array(0xA7, "BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE"),
0x2557 => array(0xA8, "BOX DRAWINGS DOUBLE DOWN AND LEFT"),
0x2558 => array(0xA9, "BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE"),
0x2559 => array(0xAA, "BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE"),
0x255A => array(0xAB, "BOX DRAWINGS DOUBLE UP AND RIGHT"),
0x255B => array(0xAC, "BOX DRAWINGS UP SINGLE AND LEFT DOUBLE"),
0x255C => array(0xAD, "BOX DRAWINGS UP DOUBLE AND LEFT SINGLE"),
0x255D => array(0xAE, "BOX DRAWINGS DOUBLE UP AND LEFT"),
0x255E => array(0xAF, "BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE"),
0x255F => array(0xB0, "BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE"),
0x2560 => array(0xB1, "BOX DRAWINGS DOUBLE VERTICAL AND RIGHT"),
0x2561 => array(0xB2, "BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE"),
0x0401 => array(0xB3, "CYRILLIC CAPITAL LETTER IO"),
0x2562 => array(0xB4, "BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE"),
0x2563 => array(0xB5, "BOX DRAWINGS DOUBLE VERTICAL AND LEFT"),
0x2564 => array(0xB6, "BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE"),
0x2565 => array(0xB7, "BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE"),
0x2566 => array(0xB8, "BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL"),
0x2567 => array(0xB9, "BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE"),
0x2568 => array(0xBA, "BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE"),
0x2569 => array(0xBB, "BOX DRAWINGS DOUBLE UP AND HORIZONTAL"),
0x256A => array(0xBC, "BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE"),
0x256B => array(0xBD, "BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE"),
0x256C => array(0xBE, "BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL"),
0x00A9 => array(0xBF, "COPYRIGHT SIGN"),
0x044E => array(0xC0, "CYRILLIC SMALL LETTER YU"),
0x0430 => array(0xC1, "CYRILLIC SMALL LETTER A"),
0x0431 => array(0xC2, "CYRILLIC SMALL LETTER BE"),
0x0446 => array(0xC3, "CYRILLIC SMALL LETTER TSE"),
0x0434 => array(0xC4, "CYRILLIC SMALL LETTER DE"),
0x0435 => array(0xC5, "CYRILLIC SMALL LETTER IE"),
0x0444 => array(0xC6, "CYRILLIC SMALL LETTER EF"),
0x0433 => array(0xC7, "CYRILLIC SMALL LETTER GHE"),
0x0445 => array(0xC8, "CYRILLIC SMALL LETTER HA"),
0x0438 => array(0xC9, "CYRILLIC SMALL LETTER I"),
0x0439 => array(0xCA, "CYRILLIC SMALL LETTER SHORT I"),
0x043A => array(0xCB, "CYRILLIC SMALL LETTER KA"),
0x043B => array(0xCC, "CYRILLIC SMALL LETTER EL"),
0x043C => array(0xCD, "CYRILLIC SMALL LETTER EM"),
0x043D => array(0xCE, "CYRILLIC SMALL LETTER EN"),
0x043E => array(0xCF, "CYRILLIC SMALL LETTER O"),
0x043F => array(0xD0, "CYRILLIC SMALL LETTER PE"),
0x044F => array(0xD1, "CYRILLIC SMALL LETTER YA"),
0x0440 => array(0xD2, "CYRILLIC SMALL LETTER ER"),
0x0441 => array(0xD3, "CYRILLIC SMALL LETTER ES"),
0x0442 => array(0xD4, "CYRILLIC SMALL LETTER TE"),
0x0443 => array(0xD5, "CYRILLIC SMALL LETTER U"),
0x0436 => array(0xD6, "CYRILLIC SMALL LETTER ZHE"),
0x0432 => array(0xD7, "CYRILLIC SMALL LETTER VE"),
0x044C => array(0xD8, "CYRILLIC SMALL LETTER SOFT SIGN"),
0x044B => array(0xD9, "CYRILLIC SMALL LETTER YERU"),
0x0437 => array(0xDA, "CYRILLIC SMALL LETTER ZE"),
0x0448 => array(0xDB, "CYRILLIC SMALL LETTER SHA"),
0x044D => array(0xDC, "CYRILLIC SMALL LETTER E"),
0x0449 => array(0xDD, "CYRILLIC SMALL LETTER SHCHA"),
0x0447 => array(0xDE, "CYRILLIC SMALL LETTER CHE"),
0x044A => array(0xDF, "CYRILLIC SMALL LETTER HARD SIGN"),
0x042E => array(0xE0, "CYRILLIC CAPITAL LETTER YU"),
0x0410 => array(0xE1, "CYRILLIC CAPITAL LETTER A"),
0x0411 => array(0xE2, "CYRILLIC CAPITAL LETTER BE"),
0x0426 => array(0xE3, "CYRILLIC CAPITAL LETTER TSE"),
0x0414 => array(0xE4, "CYRILLIC CAPITAL LETTER DE"),
0x0415 => array(0xE5, "CYRILLIC CAPITAL LETTER IE"),
0x0424 => array(0xE6, "CYRILLIC CAPITAL LETTER EF"),
0x0413 => array(0xE7, "CYRILLIC CAPITAL LETTER GHE"),
0x0425 => array(0xE8, "CYRILLIC CAPITAL LETTER HA"),
0x0418 => array(0xE9, "CYRILLIC CAPITAL LETTER I"),
0x0419 => array(0xEA, "CYRILLIC CAPITAL LETTER SHORT I"),
0x041A => array(0xEB, "CYRILLIC CAPITAL LETTER KA"),
0x041B => array(0xEC, "CYRILLIC CAPITAL LETTER EL"),
0x041C => array(0xED, "CYRILLIC CAPITAL LETTER EM"),
0x041D => array(0xEE, "CYRILLIC CAPITAL LETTER EN"),
0x041E => array(0xEF, "CYRILLIC CAPITAL LETTER O"),
0x041F => array(0xF0, "CYRILLIC CAPITAL LETTER PE"),
0x042F => array(0xF1, "CYRILLIC CAPITAL LETTER YA"),
0x0420 => array(0xF2, "CYRILLIC CAPITAL LETTER ER"),
0x0421 => array(0xF3, "CYRILLIC CAPITAL LETTER ES"),
0x0422 => array(0xF4, "CYRILLIC CAPITAL LETTER TE"),
0x0423 => array(0xF5, "CYRILLIC CAPITAL LETTER U"),
0x0416 => array(0xF6, "CYRILLIC CAPITAL LETTER ZHE"),
0x0412 => array(0xF7, "CYRILLIC CAPITAL LETTER VE"),
0x042C => array(0xF8, "CYRILLIC CAPITAL LETTER SOFT SIGN"),
0x042B => array(0xF9, "CYRILLIC CAPITAL LETTER YERU"),
0x0417 => array(0xFA, "CYRILLIC CAPITAL LETTER ZE"),
0x0428 => array(0xFB, "CYRILLIC CAPITAL LETTER SHA"),
0x042D => array(0xFC, "CYRILLIC CAPITAL LETTER E"),
0x0429 => array(0xFD, "CYRILLIC CAPITAL LETTER SHCHA"),
0x0427 => array(0xFE, "CYRILLIC CAPITAL LETTER CHE"),
0x042A => array(0xFF, "CYRILLIC CAPITAL LETTER HARD SIGN"),
);
foreach ($arr as $u => $v) {
$ent = sprintf("%X;", $u);
$res = html_entity_decode($ent, ENT_QUOTES, 'KOI8-R');
$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, 'KOI8-R');
if ($res[0] != "&" || $res[1] != "#")
$res = unpack("H*", $res)[1];
echo sprintf("%s => %s\n\n", $ent, $res);
}
--EXPECT--
BOX DRAWINGS LIGHT HORIZONTAL: ─ => 80
=>
BOX DRAWINGS LIGHT VERTICAL: │ => 81
=>
BOX DRAWINGS LIGHT DOWN AND RIGHT: ┌ => 82
=>
BOX DRAWINGS LIGHT DOWN AND LEFT: ┐ => 83
=>
BOX DRAWINGS LIGHT UP AND RIGHT: └ => 84
=>
BOX DRAWINGS LIGHT UP AND LEFT: ┘ => 85
=>
BOX DRAWINGS LIGHT VERTICAL AND RIGHT: ├ => 86
=>
BOX DRAWINGS LIGHT VERTICAL AND LEFT: ┤ => 87
=>
BOX DRAWINGS LIGHT DOWN AND HORIZONTAL: ┬ => 88
=>
BOX DRAWINGS LIGHT UP AND HORIZONTAL: ┴ => 89
=>
BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL: ┼ => 8a
=>
UPPER HALF BLOCK: ▀ => 8b
=>
LOWER HALF BLOCK: ▄ => 8c
=>
FULL BLOCK: █ => 8d
=>
LEFT HALF BLOCK: ▌ => 8e
=>
RIGHT HALF BLOCK: ▐ => 8f
=>
LIGHT SHADE: ░ => 90
=>
MEDIUM SHADE: ▒ => 91
=>
DARK SHADE: ▓ => 92
=>
TOP HALF INTEGRAL: ⌠ => 93
=>
BLACK SQUARE: ■ => 94
=>
BULLET OPERATOR: ∙ => 95
=>
SQUARE ROOT: √ => 96
=>
ALMOST EQUAL TO: ≈ => 97
=>
LESS-THAN OR EQUAL TO: ≤ => 98
=>
GREATER-THAN OR EQUAL TO: ≥ => 99
=>
NO-BREAK SPACE: => 9a
=>
BOTTOM HALF INTEGRAL: ⌡ => 9b
=>
DEGREE SIGN: ° => 9c
=>
SUPERSCRIPT TWO: ² => 9d
=>
MIDDLE DOT: · => 9e
=>
DIVISION SIGN: ÷ => 9f
=>
BOX DRAWINGS DOUBLE HORIZONTAL: ═ => a0
=> 9a
BOX DRAWINGS DOUBLE VERTICAL: ║ => a1
¡ => ¡
BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE: ╒ => a2
¢ => ¢
CYRILLIC SMALL LETTER IO: ё => a3
£ => £
BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE: ╓ => a4
¤ => ¤
BOX DRAWINGS DOUBLE DOWN AND RIGHT: ╔ => a5
¥ => ¥
BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE: ╕ => a6
¦ => ¦
BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE: ╖ => a7
§ => §
BOX DRAWINGS DOUBLE DOWN AND LEFT: ╗ => a8
¨ => ¨
BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE: ╘ => a9
© => bf
BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE: ╙ => aa
ª => ª
BOX DRAWINGS DOUBLE UP AND RIGHT: ╚ => ab
« => «
BOX DRAWINGS UP SINGLE AND LEFT DOUBLE: ╛ => ac
¬ => ¬
BOX DRAWINGS UP DOUBLE AND LEFT SINGLE: ╜ => ad
=>
BOX DRAWINGS DOUBLE UP AND LEFT: ╝ => ae
® => ®
BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE: ╞ => af
¯ => ¯
BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE: ╟ => b0
° => 9c
BOX DRAWINGS DOUBLE VERTICAL AND RIGHT: ╠ => b1
± => ±
BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE: ╡ => b2
² => 9d
CYRILLIC CAPITAL LETTER IO: Ё => b3
³ => ³
BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE: ╢ => b4
´ => ´
BOX DRAWINGS DOUBLE VERTICAL AND LEFT: ╣ => b5
µ => µ
BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE: ╤ => b6
¶ => ¶
BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE: ╥ => b7
· => 9e
BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL: ╦ => b8
¸ => ¸
BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE: ╧ => b9
¹ => ¹
BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE: ╨ => ba
º => º
BOX DRAWINGS DOUBLE UP AND HORIZONTAL: ╩ => bb
» => »
BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE: ╪ => bc
¼ => ¼
BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE: ╫ => bd
½ => ½
BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL: ╬ => be
¾ => ¾
COPYRIGHT SIGN: © => bf
¿ => ¿
CYRILLIC SMALL LETTER YU: ю => c0
À => À
CYRILLIC SMALL LETTER A: а => c1
Á => Á
CYRILLIC SMALL LETTER BE: б => c2
 => Â
CYRILLIC SMALL LETTER TSE: ц => c3
à => Ã
CYRILLIC SMALL LETTER DE: д => c4
Ä => Ä
CYRILLIC SMALL LETTER IE: е => c5
Å => Å
CYRILLIC SMALL LETTER EF: ф => c6
Æ => Æ
CYRILLIC SMALL LETTER GHE: г => c7
Ç => Ç
CYRILLIC SMALL LETTER HA: х => c8
È => È
CYRILLIC SMALL LETTER I: и => c9
É => É
CYRILLIC SMALL LETTER SHORT I: й => ca
Ê => Ê
CYRILLIC SMALL LETTER KA: к => cb
Ë => Ë
CYRILLIC SMALL LETTER EL: л => cc
Ì => Ì
CYRILLIC SMALL LETTER EM: м => cd
Í => Í
CYRILLIC SMALL LETTER EN: н => ce
Î => Î
CYRILLIC SMALL LETTER O: о => cf
Ï => Ï
CYRILLIC SMALL LETTER PE: п => d0
Ð => Ð
CYRILLIC SMALL LETTER YA: я => d1
Ñ => Ñ
CYRILLIC SMALL LETTER ER: р => d2
Ò => Ò
CYRILLIC SMALL LETTER ES: с => d3
Ó => Ó
CYRILLIC SMALL LETTER TE: т => d4
Ô => Ô
CYRILLIC SMALL LETTER U: у => d5
Õ => Õ
CYRILLIC SMALL LETTER ZHE: ж => d6
Ö => Ö
CYRILLIC SMALL LETTER VE: в => d7
× => ×
CYRILLIC SMALL LETTER SOFT SIGN: ь => d8
Ø => Ø
CYRILLIC SMALL LETTER YERU: ы => d9
Ù => Ù
CYRILLIC SMALL LETTER ZE: з => da
Ú => Ú
CYRILLIC SMALL LETTER SHA: ш => db
Û => Û
CYRILLIC SMALL LETTER E: э => dc
Ü => Ü
CYRILLIC SMALL LETTER SHCHA: щ => dd
Ý => Ý
CYRILLIC SMALL LETTER CHE: ч => de
Þ => Þ
CYRILLIC SMALL LETTER HARD SIGN: ъ => df
ß => ß
CYRILLIC CAPITAL LETTER YU: Ю => e0
à => à
CYRILLIC CAPITAL LETTER A: А => e1
á => á
CYRILLIC CAPITAL LETTER BE: Б => e2
â => â
CYRILLIC CAPITAL LETTER TSE: Ц => e3
ã => ã
CYRILLIC CAPITAL LETTER DE: Д => e4
ä => ä
CYRILLIC CAPITAL LETTER IE: Е => e5
å => å
CYRILLIC CAPITAL LETTER EF: Ф => e6
æ => æ
CYRILLIC CAPITAL LETTER GHE: Г => e7
ç => ç
CYRILLIC CAPITAL LETTER HA: Х => e8
è => è
CYRILLIC CAPITAL LETTER I: И => e9
é => é
CYRILLIC CAPITAL LETTER SHORT I: Й => ea
ê => ê
CYRILLIC CAPITAL LETTER KA: К => eb
ë => ë
CYRILLIC CAPITAL LETTER EL: Л => ec
ì => ì
CYRILLIC CAPITAL LETTER EM: М => ed
í => í
CYRILLIC CAPITAL LETTER EN: Н => ee
î => î
CYRILLIC CAPITAL LETTER O: О => ef
ï => ï
CYRILLIC CAPITAL LETTER PE: П => f0
ð => ð
CYRILLIC CAPITAL LETTER YA: Я => f1
ñ => ñ
CYRILLIC CAPITAL LETTER ER: Р => f2
ò => ò
CYRILLIC CAPITAL LETTER ES: С => f3
ó => ó
CYRILLIC CAPITAL LETTER TE: Т => f4
ô => ô
CYRILLIC CAPITAL LETTER U: У => f5
õ => õ
CYRILLIC CAPITAL LETTER ZHE: Ж => f6
ö => ö
CYRILLIC CAPITAL LETTER VE: В => f7
÷ => 9f
CYRILLIC CAPITAL LETTER SOFT SIGN: Ь => f8
ø => ø
CYRILLIC CAPITAL LETTER YERU: Ы => f9
ù => ù
CYRILLIC CAPITAL LETTER ZE: З => fa
ú => ú
CYRILLIC CAPITAL LETTER SHA: Ш => fb
û => û
CYRILLIC CAPITAL LETTER E: Э => fc
ü => ü
CYRILLIC CAPITAL LETTER SHCHA: Щ => fd
ý => ý
CYRILLIC CAPITAL LETTER CHE: Ч => fe
þ => þ
CYRILLIC CAPITAL LETTER HARD SIGN: Ъ => ff
ÿ => ÿ