--TEST--
Translation of HTML entities for encoding ISO-8859-15
--FILE--
<?php
$arr = array(
0x00A0 => array(0xA0, "NO-BREAK SPACE"),
0x00A1 => array(0xA1, "INVERTED EXCLAMATION MARK"),
0x00A2 => array(0xA2, "CENT SIGN"),
0x00A3 => array(0xA3, "POUND SIGN"),
0x20AC => array(0xA4, "EURO SIGN"),
0x00A5 => array(0xA5, "YEN SIGN"),
0x0160 => array(0xA6, "LATIN CAPITAL LETTER S WITH CARON"),
0x00A7 => array(0xA7, "SECTION SIGN"),
0x0161 => array(0xA8, "LATIN SMALL LETTER S WITH CARON"),
0x00A9 => array(0xA9, "COPYRIGHT SIGN"),
0x00AA => array(0xAA, "FEMININE ORDINAL INDICATOR"),
0x00AB => array(0xAB, "LEFT-POINTING DOUBLE ANGLE QUOTATION MARK"),
0x00AC => array(0xAC, "NOT SIGN"),
0x00AD => array(0xAD, "SOFT HYPHEN"),
0x00AE => array(0xAE, "REGISTERED SIGN"),
0x00AF => array(0xAF, "MACRON"),
0x00B0 => array(0xB0, "DEGREE SIGN"),
0x00B1 => array(0xB1, "PLUS-MINUS SIGN"),
0x00B2 => array(0xB2, "SUPERSCRIPT TWO"),
0x00B3 => array(0xB3, "SUPERSCRIPT THREE"),
0x017D => array(0xB4, "LATIN CAPITAL LETTER Z WITH CARON"),
0x00B5 => array(0xB5, "MICRO SIGN"),
0x00B6 => array(0xB6, "PILCROW SIGN"),
0x00B7 => array(0xB7, "MIDDLE DOT"),
0x017E => array(0xB8, "LATIN SMALL LETTER Z WITH CARON"),
0x00B9 => array(0xB9, "SUPERSCRIPT ONE"),
0x00BA => array(0xBA, "MASCULINE ORDINAL INDICATOR"),
0x00BB => array(0xBB, "RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK"),
0x0152 => array(0xBC, "LATIN CAPITAL LIGATURE OE"),
0x0153 => array(0xBD, "LATIN SMALL LIGATURE OE"),
0x0178 => array(0xBE, "LATIN CAPITAL LETTER Y WITH DIAERESIS"),
0x00BF => array(0xBF, "INVERTED QUESTION MARK"),
0x00C0 => array(0xC0, "LATIN CAPITAL LETTER A WITH GRAVE"),
0x00C1 => array(0xC1, "LATIN CAPITAL LETTER A WITH ACUTE"),
0x00C2 => array(0xC2, "LATIN CAPITAL LETTER A WITH CIRCUMFLEX"),
0x00C3 => array(0xC3, "LATIN CAPITAL LETTER A WITH TILDE"),
0x00C4 => array(0xC4, "LATIN CAPITAL LETTER A WITH DIAERESIS"),
0x00C5 => array(0xC5, "LATIN CAPITAL LETTER A WITH RING ABOVE"),
0x00C6 => array(0xC6, "LATIN CAPITAL LETTER AE"),
0x00C7 => array(0xC7, "LATIN CAPITAL LETTER C WITH CEDILLA"),
0x00C8 => array(0xC8, "LATIN CAPITAL LETTER E WITH GRAVE"),
0x00C9 => array(0xC9, "LATIN CAPITAL LETTER E WITH ACUTE"),
0x00CA => array(0xCA, "LATIN CAPITAL LETTER E WITH CIRCUMFLEX"),
0x00CB => array(0xCB, "LATIN CAPITAL LETTER E WITH DIAERESIS"),
0x00CC => array(0xCC, "LATIN CAPITAL LETTER I WITH GRAVE"),
0x00CD => array(0xCD, "LATIN CAPITAL LETTER I WITH ACUTE"),
0x00CE => array(0xCE, "LATIN CAPITAL LETTER I WITH CIRCUMFLEX"),
0x00CF => array(0xCF, "LATIN CAPITAL LETTER I WITH DIAERESIS"),
0x00D0 => array(0xD0, "LATIN CAPITAL LETTER ETH"),
0x00D1 => array(0xD1, "LATIN CAPITAL LETTER N WITH TILDE"),
0x00D2 => array(0xD2, "LATIN CAPITAL LETTER O WITH GRAVE"),
0x00D3 => array(0xD3, "LATIN CAPITAL LETTER O WITH ACUTE"),
0x00D4 => array(0xD4, "LATIN CAPITAL LETTER O WITH CIRCUMFLEX"),
0x00D5 => array(0xD5, "LATIN CAPITAL LETTER O WITH TILDE"),
0x00D6 => array(0xD6, "LATIN CAPITAL LETTER O WITH DIAERESIS"),
0x00D7 => array(0xD7, "MULTIPLICATION SIGN"),
0x00D8 => array(0xD8, "LATIN CAPITAL LETTER O WITH STROKE"),
0x00D9 => array(0xD9, "LATIN CAPITAL LETTER U WITH GRAVE"),
0x00DA => array(0xDA, "LATIN CAPITAL LETTER U WITH ACUTE"),
0x00DB => array(0xDB, "LATIN CAPITAL LETTER U WITH CIRCUMFLEX"),
0x00DC => array(0xDC, "LATIN CAPITAL LETTER U WITH DIAERESIS"),
0x00DD => array(0xDD, "LATIN CAPITAL LETTER Y WITH ACUTE"),
0x00DE => array(0xDE, "LATIN CAPITAL LETTER THORN"),
0x00DF => array(0xDF, "LATIN SMALL LETTER SHARP S"),
0x00E0 => array(0xE0, "LATIN SMALL LETTER A WITH GRAVE"),
0x00E1 => array(0xE1, "LATIN SMALL LETTER A WITH ACUTE"),
0x00E2 => array(0xE2, "LATIN SMALL LETTER A WITH CIRCUMFLEX"),
0x00E3 => array(0xE3, "LATIN SMALL LETTER A WITH TILDE"),
0x00E4 => array(0xE4, "LATIN SMALL LETTER A WITH DIAERESIS"),
0x00E5 => array(0xE5, "LATIN SMALL LETTER A WITH RING ABOVE"),
0x00E6 => array(0xE6, "LATIN SMALL LETTER AE"),
0x00E7 => array(0xE7, "LATIN SMALL LETTER C WITH CEDILLA"),
0x00E8 => array(0xE8, "LATIN SMALL LETTER E WITH GRAVE"),
0x00E9 => array(0xE9, "LATIN SMALL LETTER E WITH ACUTE"),
0x00EA => array(0xEA, "LATIN SMALL LETTER E WITH CIRCUMFLEX"),
0x00EB => array(0xEB, "LATIN SMALL LETTER E WITH DIAERESIS"),
0x00EC => array(0xEC, "LATIN SMALL LETTER I WITH GRAVE"),
0x00ED => array(0xED, "LATIN SMALL LETTER I WITH ACUTE"),
0x00EE => array(0xEE, "LATIN SMALL LETTER I WITH CIRCUMFLEX"),
0x00EF => array(0xEF, "LATIN SMALL LETTER I WITH DIAERESIS"),
0x00F0 => array(0xF0, "LATIN SMALL LETTER ETH"),
0x00F1 => array(0xF1, "LATIN SMALL LETTER N WITH TILDE"),
0x00F2 => array(0xF2, "LATIN SMALL LETTER O WITH GRAVE"),
0x00F3 => array(0xF3, "LATIN SMALL LETTER O WITH ACUTE"),
0x00F4 => array(0xF4, "LATIN SMALL LETTER O WITH CIRCUMFLEX"),
0x00F5 => array(0xF5, "LATIN SMALL LETTER O WITH TILDE"),
0x00F6 => array(0xF6, "LATIN SMALL LETTER O WITH DIAERESIS"),
0x00F7 => array(0xF7, "DIVISION SIGN"),
0x00F8 => array(0xF8, "LATIN SMALL LETTER O WITH STROKE"),
0x00F9 => array(0xF9, "LATIN SMALL LETTER U WITH GRAVE"),
0x00FA => array(0xFA, "LATIN SMALL LETTER U WITH ACUTE"),
0x00FB => array(0xFB, "LATIN SMALL LETTER U WITH CIRCUMFLEX"),
0x00FC => array(0xFC, "LATIN SMALL LETTER U WITH DIAERESIS"),
0x00FD => array(0xFD, "LATIN SMALL LETTER Y WITH ACUTE"),
0x00FE => array(0xFE, "LATIN SMALL LETTER THORN"),
0x00FF => array(0xFF, "LATIN SMALL LETTER Y WITH DIAERESIS"),
);

foreach ($arr as $u => $v) {
    $ent = sprintf("&#x%X;", $u);
    $res = html_entity_decode($ent, ENT_QUOTES, 'ISO-8859-15');
    $d = unpack("H*", $res);
    echo sprintf("%s: %s => %s\n", $v[1], $ent, $d[1]);

    $ent = sprintf("&#x%X;", $v[0]);
    $res = html_entity_decode($ent, ENT_QUOTES, 'ISO-8859-15');
    if ($res[0] != "&" || $res[1] != "#")
        $res = unpack("H*", $res)[1];
    echo sprintf("%s => %s\n\n", $ent, $res);
}
?>
--EXPECT--
NO-BREAK SPACE: &#xA0; => a0
&#xA0; => a0

INVERTED EXCLAMATION MARK: &#xA1; => a1
&#xA1; => a1

CENT SIGN: &#xA2; => a2
&#xA2; => a2

POUND SIGN: &#xA3; => a3
&#xA3; => a3

EURO SIGN: &#x20AC; => a4
&#xA4; => &#xA4;

YEN SIGN: &#xA5; => a5
&#xA5; => a5

LATIN CAPITAL LETTER S WITH CARON: &#x160; => a6
&#xA6; => &#xA6;

SECTION SIGN: &#xA7; => a7
&#xA7; => a7

LATIN SMALL LETTER S WITH CARON: &#x161; => a8
&#xA8; => &#xA8;

COPYRIGHT SIGN: &#xA9; => a9
&#xA9; => a9

FEMININE ORDINAL INDICATOR: &#xAA; => aa
&#xAA; => aa

LEFT-POINTING DOUBLE ANGLE QUOTATION MARK: &#xAB; => ab
&#xAB; => ab

NOT SIGN: &#xAC; => ac
&#xAC; => ac

SOFT HYPHEN: &#xAD; => ad
&#xAD; => ad

REGISTERED SIGN: &#xAE; => ae
&#xAE; => ae

MACRON: &#xAF; => af
&#xAF; => af

DEGREE SIGN: &#xB0; => b0
&#xB0; => b0

PLUS-MINUS SIGN: &#xB1; => b1
&#xB1; => b1

SUPERSCRIPT TWO: &#xB2; => b2
&#xB2; => b2

SUPERSCRIPT THREE: &#xB3; => b3
&#xB3; => b3

LATIN CAPITAL LETTER Z WITH CARON: &#x17D; => b4
&#xB4; => &#xB4;

MICRO SIGN: &#xB5; => b5
&#xB5; => b5

PILCROW SIGN: &#xB6; => b6
&#xB6; => b6

MIDDLE DOT: &#xB7; => b7
&#xB7; => b7

LATIN SMALL LETTER Z WITH CARON: &#x17E; => b8
&#xB8; => &#xB8;

SUPERSCRIPT ONE: &#xB9; => b9
&#xB9; => b9

MASCULINE ORDINAL INDICATOR: &#xBA; => ba
&#xBA; => ba

RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK: &#xBB; => bb
&#xBB; => bb

LATIN CAPITAL LIGATURE OE: &#x152; => bc
&#xBC; => &#xBC;

LATIN SMALL LIGATURE OE: &#x153; => bd
&#xBD; => &#xBD;

LATIN CAPITAL LETTER Y WITH DIAERESIS: &#x178; => be
&#xBE; => &#xBE;

INVERTED QUESTION MARK: &#xBF; => bf
&#xBF; => bf

LATIN CAPITAL LETTER A WITH GRAVE: &#xC0; => c0
&#xC0; => c0

LATIN CAPITAL LETTER A WITH ACUTE: &#xC1; => c1
&#xC1; => c1

LATIN CAPITAL LETTER A WITH CIRCUMFLEX: &#xC2; => c2
&#xC2; => c2

LATIN CAPITAL LETTER A WITH TILDE: &#xC3; => c3
&#xC3; => c3

LATIN CAPITAL LETTER A WITH DIAERESIS: &#xC4; => c4
&#xC4; => c4

LATIN CAPITAL LETTER A WITH RING ABOVE: &#xC5; => c5
&#xC5; => c5

LATIN CAPITAL LETTER AE: &#xC6; => c6
&#xC6; => c6

LATIN CAPITAL LETTER C WITH CEDILLA: &#xC7; => c7
&#xC7; => c7

LATIN CAPITAL LETTER E WITH GRAVE: &#xC8; => c8
&#xC8; => c8

LATIN CAPITAL LETTER E WITH ACUTE: &#xC9; => c9
&#xC9; => c9

LATIN CAPITAL LETTER E WITH CIRCUMFLEX: &#xCA; => ca
&#xCA; => ca

LATIN CAPITAL LETTER E WITH DIAERESIS: &#xCB; => cb
&#xCB; => cb

LATIN CAPITAL LETTER I WITH GRAVE: &#xCC; => cc
&#xCC; => cc

LATIN CAPITAL LETTER I WITH ACUTE: &#xCD; => cd
&#xCD; => cd

LATIN CAPITAL LETTER I WITH CIRCUMFLEX: &#xCE; => ce
&#xCE; => ce

LATIN CAPITAL LETTER I WITH DIAERESIS: &#xCF; => cf
&#xCF; => cf

LATIN CAPITAL LETTER ETH: &#xD0; => d0
&#xD0; => d0

LATIN CAPITAL LETTER N WITH TILDE: &#xD1; => d1
&#xD1; => d1

LATIN CAPITAL LETTER O WITH GRAVE: &#xD2; => d2
&#xD2; => d2

LATIN CAPITAL LETTER O WITH ACUTE: &#xD3; => d3
&#xD3; => d3

LATIN CAPITAL LETTER O WITH CIRCUMFLEX: &#xD4; => d4
&#xD4; => d4

LATIN CAPITAL LETTER O WITH TILDE: &#xD5; => d5
&#xD5; => d5

LATIN CAPITAL LETTER O WITH DIAERESIS: &#xD6; => d6
&#xD6; => d6

MULTIPLICATION SIGN: &#xD7; => d7
&#xD7; => d7

LATIN CAPITAL LETTER O WITH STROKE: &#xD8; => d8
&#xD8; => d8

LATIN CAPITAL LETTER U WITH GRAVE: &#xD9; => d9
&#xD9; => d9

LATIN CAPITAL LETTER U WITH ACUTE: &#xDA; => da
&#xDA; => da

LATIN CAPITAL LETTER U WITH CIRCUMFLEX: &#xDB; => db
&#xDB; => db

LATIN CAPITAL LETTER U WITH DIAERESIS: &#xDC; => dc
&#xDC; => dc

LATIN CAPITAL LETTER Y WITH ACUTE: &#xDD; => dd
&#xDD; => dd

LATIN CAPITAL LETTER THORN: &#xDE; => de
&#xDE; => de

LATIN SMALL LETTER SHARP S: &#xDF; => df
&#xDF; => df

LATIN SMALL LETTER A WITH GRAVE: &#xE0; => e0
&#xE0; => e0

LATIN SMALL LETTER A WITH ACUTE: &#xE1; => e1
&#xE1; => e1

LATIN SMALL LETTER A WITH CIRCUMFLEX: &#xE2; => e2
&#xE2; => e2

LATIN SMALL LETTER A WITH TILDE: &#xE3; => e3
&#xE3; => e3

LATIN SMALL LETTER A WITH DIAERESIS: &#xE4; => e4
&#xE4; => e4

LATIN SMALL LETTER A WITH RING ABOVE: &#xE5; => e5
&#xE5; => e5

LATIN SMALL LETTER AE: &#xE6; => e6
&#xE6; => e6

LATIN SMALL LETTER C WITH CEDILLA: &#xE7; => e7
&#xE7; => e7

LATIN SMALL LETTER E WITH GRAVE: &#xE8; => e8
&#xE8; => e8

LATIN SMALL LETTER E WITH ACUTE: &#xE9; => e9
&#xE9; => e9

LATIN SMALL LETTER E WITH CIRCUMFLEX: &#xEA; => ea
&#xEA; => ea

LATIN SMALL LETTER E WITH DIAERESIS: &#xEB; => eb
&#xEB; => eb

LATIN SMALL LETTER I WITH GRAVE: &#xEC; => ec
&#xEC; => ec

LATIN SMALL LETTER I WITH ACUTE: &#xED; => ed
&#xED; => ed

LATIN SMALL LETTER I WITH CIRCUMFLEX: &#xEE; => ee
&#xEE; => ee

LATIN SMALL LETTER I WITH DIAERESIS: &#xEF; => ef
&#xEF; => ef

LATIN SMALL LETTER ETH: &#xF0; => f0
&#xF0; => f0

LATIN SMALL LETTER N WITH TILDE: &#xF1; => f1
&#xF1; => f1

LATIN SMALL LETTER O WITH GRAVE: &#xF2; => f2
&#xF2; => f2

LATIN SMALL LETTER O WITH ACUTE: &#xF3; => f3
&#xF3; => f3

LATIN SMALL LETTER O WITH CIRCUMFLEX: &#xF4; => f4
&#xF4; => f4

LATIN SMALL LETTER O WITH TILDE: &#xF5; => f5
&#xF5; => f5

LATIN SMALL LETTER O WITH DIAERESIS: &#xF6; => f6
&#xF6; => f6

DIVISION SIGN: &#xF7; => f7
&#xF7; => f7

LATIN SMALL LETTER O WITH STROKE: &#xF8; => f8
&#xF8; => f8

LATIN SMALL LETTER U WITH GRAVE: &#xF9; => f9
&#xF9; => f9

LATIN SMALL LETTER U WITH ACUTE: &#xFA; => fa
&#xFA; => fa

LATIN SMALL LETTER U WITH CIRCUMFLEX: &#xFB; => fb
&#xFB; => fb

LATIN SMALL LETTER U WITH DIAERESIS: &#xFC; => fc
&#xFC; => fc

LATIN SMALL LETTER Y WITH ACUTE: &#xFD; => fd
&#xFD; => fd

LATIN SMALL LETTER THORN: &#xFE; => fe
&#xFE; => fe

LATIN SMALL LETTER Y WITH DIAERESIS: &#xFF; => ff
&#xFF; => ff
