Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| Constants | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | declare( strict_types = 1 ); |
| 3 | |
| 4 | namespace UtfNormal; |
| 5 | |
| 6 | /** |
| 7 | * This program is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU General Public License as published by |
| 9 | * the Free Software Foundation; either version 2 of the License, or |
| 10 | * (at your option) any later version. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License along |
| 18 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 19 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 20 | * http://www.gnu.org/copyleft/gpl.html |
| 21 | * |
| 22 | * @file |
| 23 | */ |
| 24 | |
| 25 | /** |
| 26 | * Some constant definitions for the unicode normalization module. |
| 27 | * |
| 28 | * Note: these constants must all be resolvable at compile time by HipHop, |
| 29 | * since this file will not be executed during request startup for a compiled |
| 30 | * MediaWiki. |
| 31 | * |
| 32 | * @ingroup UtfNormal |
| 33 | */ |
| 34 | class Constants { |
| 35 | public const UNICODE_HANGUL_FIRST = 0xac00; |
| 36 | public const UNICODE_HANGUL_LAST = 0xd7a3; |
| 37 | |
| 38 | public const UNICODE_HANGUL_LBASE = 0x1100; |
| 39 | public const UNICODE_HANGUL_VBASE = 0x1161; |
| 40 | public const UNICODE_HANGUL_TBASE = 0x11a7; |
| 41 | |
| 42 | public const UNICODE_HANGUL_LCOUNT = 19; |
| 43 | public const UNICODE_HANGUL_VCOUNT = 21; |
| 44 | public const UNICODE_HANGUL_TCOUNT = 28; |
| 45 | |
| 46 | public const UNICODE_HANGUL_NCOUNT = self::UNICODE_HANGUL_VCOUNT * self::UNICODE_HANGUL_TCOUNT; |
| 47 | |
| 48 | public const UNICODE_HANGUL_LEND = self::UNICODE_HANGUL_LBASE + self::UNICODE_HANGUL_LCOUNT - 1; |
| 49 | public const UNICODE_HANGUL_VEND = self::UNICODE_HANGUL_VBASE + self::UNICODE_HANGUL_VCOUNT - 1; |
| 50 | public const UNICODE_HANGUL_TEND = self::UNICODE_HANGUL_TBASE + self::UNICODE_HANGUL_TCOUNT - 1; |
| 51 | |
| 52 | public const UNICODE_SURROGATE_FIRST = 0xd800; |
| 53 | public const UNICODE_SURROGATE_LAST = 0xdfff; |
| 54 | public const UNICODE_MAX = 0x10ffff; |
| 55 | public const UNICODE_REPLACEMENT = 0xfffd; |
| 56 | |
| 57 | # codepointToUtf8( UNICODE_HANGUL_FIRST ) |
| 58 | public const UTF8_HANGUL_FIRST = "\xea\xb0\x80"; |
| 59 | # codepointToUtf8( UNICODE_HANGUL_LAST ) |
| 60 | public const UTF8_HANGUL_LAST = "\xed\x9e\xa3"; |
| 61 | |
| 62 | # codepointToUtf8( UNICODE_HANGUL_LBASE ) |
| 63 | public const UTF8_HANGUL_LBASE = "\xe1\x84\x80"; |
| 64 | # codepointToUtf8( UNICODE_HANGUL_VBASE ) |
| 65 | public const UTF8_HANGUL_VBASE = "\xe1\x85\xa1"; |
| 66 | # codepointToUtf8( UNICODE_HANGUL_TBASE ) |
| 67 | public const UTF8_HANGUL_TBASE = "\xe1\x86\xa7"; |
| 68 | |
| 69 | # codepointToUtf8( UNICODE_HANGUL_LEND ) |
| 70 | public const UTF8_HANGUL_LEND = "\xe1\x84\x92"; |
| 71 | # codepointToUtf8( UNICODE_HANGUL_VEND ) |
| 72 | public const UTF8_HANGUL_VEND = "\xe1\x85\xb5"; |
| 73 | # codepointToUtf8( UNICODE_HANGUL_TEND ) |
| 74 | public const UTF8_HANGUL_TEND = "\xe1\x87\x82"; |
| 75 | |
| 76 | # codepointToUtf8( UNICODE_SURROGATE_FIRST ) |
| 77 | public const UTF8_SURROGATE_FIRST = "\xed\xa0\x80"; |
| 78 | # codepointToUtf8( UNICODE_SURROGATE_LAST ) |
| 79 | public const UTF8_SURROGATE_LAST = "\xed\xbf\xbf"; |
| 80 | # codepointToUtf8( UNICODE_MAX ) |
| 81 | public const UTF8_MAX = "\xf4\x8f\xbf\xbf"; |
| 82 | # codepointToUtf8( UNICODE_REPLACEMENT ) |
| 83 | public const UTF8_REPLACEMENT = "\xef\xbf\xbd"; |
| 84 | # public const UTF8_REPLACEMENT = '!'; |
| 85 | |
| 86 | public const UTF8_OVERLONG_A = "\xc1\xbf"; |
| 87 | public const UTF8_OVERLONG_B = "\xe0\x9f\xbf"; |
| 88 | public const UTF8_OVERLONG_C = "\xf0\x8f\xbf\xbf"; |
| 89 | |
| 90 | # These two ranges are illegal |
| 91 | # codepointToUtf8( 0xfdd0 ) |
| 92 | public const UTF8_FDD0 = "\xef\xb7\x90"; |
| 93 | # codepointToUtf8( 0xfdef ) |
| 94 | public const UTF8_FDEF = "\xef\xb7\xaf"; |
| 95 | # codepointToUtf8( 0xfffe ) |
| 96 | public const UTF8_FFFE = "\xef\xbf\xbe"; |
| 97 | # codepointToUtf8( 0xffff ) |
| 98 | public const UTF8_FFFF = "\xef\xbf\xbf"; |
| 99 | |
| 100 | public const UTF8_HEAD = false; |
| 101 | public const UTF8_TAIL = true; |
| 102 | |
| 103 | } |