1 | <?php |
||
12 | class CharacterReference |
||
13 | { |
||
14 | |||
15 | protected static $numeric_mask = array( |
||
16 | 0x0, |
||
17 | 0x2FFFF, |
||
18 | 0, |
||
19 | 0xFFFF |
||
20 | ); |
||
21 | |||
22 | /** |
||
23 | * Given a name (e.g. |
||
24 | * 'amp'), lookup the UTF-8 character ('&') |
||
25 | * |
||
26 | * @param string $name |
||
27 | * The name to look up. |
||
28 | * @return string The character sequence. In UTF-8 this may be more than one byte. |
||
29 | */ |
||
30 | 12 | public static function lookupName($name) |
|
35 | |||
36 | /** |
||
37 | * Given a Unicode codepoint, return the UTF-8 character. |
||
38 | * |
||
39 | * (NOT USED ANYWHERE) |
||
40 | */ |
||
41 | /* |
||
42 | * public static function lookupCode($codePoint) { return 'POINT'; } |
||
43 | */ |
||
44 | |||
45 | /** |
||
46 | * Given a decimal number, return the UTF-8 character. |
||
47 | */ |
||
48 | 4 | public static function lookupDecimal($int) |
|
55 | |||
56 | /** |
||
57 | * Given a hexidecimal number, return the UTF-8 character. |
||
58 | */ |
||
59 | 3 | public static function lookupHex($hexdec) |
|
63 | } |
||
64 |