0
     ˆÅÄ…iá<óŸÃÂÁ ?÷     /*
   +----------------------------------------------------------------------+
   | PHP Version 5                                                        |
   +----------------------------------------------------------------------+
   | Copyright (c) 1997-2016 The PHP Group                                |
   +----------------------------------------------------------------------+
   | This source file is subject to version 3.01 of the PHP license,      |
   | that is bundled with this package in the file LICENSE, and is        |
   | available through the world-wide-web at the following url:           |
   | http://www.php.net/license/3_01.txt                                  |
   | If you did not receive a copy of the PHP license and are unable to   |
   | obtain it through the world-wide-web, please send a note to          |
   | license@php.net so we can mail you a copy immediately.               |
   +----------------------------------------------------------------------+
*/

/* $Id$ */

#ifndef HTML_TABLES_H
#define HTML_TABLES_H

/**************************************************************************
***************************************************************************
**        THIS FILE IS AUTOMATICALLY GENERATED. DO NOT MODIFY IT.        **
***************************************************************************
** Please change html_tables/html_table_gen.php instead and then         **
** run it in order to generate this file                                 **
***************************************************************************
**************************************************************************/

enum entity_charset { cs_utf_8, cs_8859_1, cs_cp1252, cs_8859_15, cs_cp1251,
					  cs_8859_5, cs_cp866, cs_macroman, cs_koi8r, cs_big5,
					  cs_gb2312, cs_big5hkscs, cs_sjis, cs_eucjp,
					  cs_numelems /* used to count the number of charsets */
					};
#define CHARSET_UNICODE_COMPAT(cs)	((cs) <= cs_8859_1)
#define CHARSET_SINGLE_BYTE(cs)		((cs) > cs_utf_8 && (cs) < cs_big5)
#define CHARSET_PARTIAL_SUPPORT(cs)	((cs) >= cs_big5)

static const struct {
	const char *codeset;
	enum entity_charset charset;
} charset_map[] = {
	{ "ISO-8859-1",		cs_8859_1 },
	{ "ISO8859-1",		cs_8859_1 },
	{ "ISO-8859-15",	cs_8859_15 },
	{ "ISO8859-15",		cs_8859_15 },
	{ "utf-8",			cs_utf_8 },
	{ "cp1252", 		cs_cp1252 },
	{ "Windows-1252",	cs_cp1252 },
	{ "1252",			cs_cp1252 }, 
	{ "BIG5",			cs_big5 },
	{ "950",			cs_big5 },
	{ "GB2312",			cs_gb2312 },
	{ "936",			cs_gb2312 },
	{ "BIG5-HKSCS",		cs_big5hkscs },
	{ "Shift_JIS",		cs_sjis },
	{ "SJIS",			cs_sjis },
	{ "932",			cs_sjis },
	{ "SJIS-win",		cs_sjis },
	{ "CP932",			cs_sjis },
	{ "EUCJP",			cs_eucjp },
	{ "EUC-JP",			cs_eucjp },
	{ "eucJP-win",		cs_eucjp },
	{ "KOI8-R",			cs_koi8r },
	{ "koi8-ru",		cs_koi8r },
	{ "koi8r",			cs_koi8r },
	{ "cp1251",			cs_cp1251 },
	{ "Windows-1251",	cs_cp1251 },
	{ "win-1251",		cs_cp1251 },
	{ "iso8859-5",		cs_8859_5 },
	{ "iso-8859-5",		cs_8859_5 },
	{ "cp866",			cs_cp866 },
	{ "866",			cs_cp866 },    
	{ "ibm866",			cs_cp866 },
	{ "MacRoman",		cs_macroman },
	{ NULL }
};

/* longest entity name length excluding & and ; */
#define LONGEST_ENTITY_LENGTH 31

/* Definitions for mappings *to* Unicode.
 * The origin charset must have at most 256 code points.
 * The multi-byte encodings are not supported */
typedef struct {
    unsigned short uni_cp[64];
} enc_to_uni_stage2;

typedef struct {
    const enc_to_uni_stage2 *inner[4];
} enc_to_uni;

/* bits 7-8 bits (only single bytes encodings supported )*/
#define ENT_ENC_TO_UNI_STAGE1(k) ((k & 0xC0) >> 6)
/* bits 1-6 */
#define ENT_ENC_TO_UNI_STAGE2(k) ((k) & 0x3F)

/* {{{ Mappings *to* Unicode for ISO-8859-1 */

/* {{{ Stage 2 tables for ISO-8859-1 */

static const enc_to_uni_stage2 enc_to_uni_s2_iso88591_00 = { {
	0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005,
	0x0006, 0x0007, 0x0008, 0x0009, 0x000A, 0x000B,
	0x000C, 0x000D, 0x000E, 0x000F, 0x0010, 0x0011,
	0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017,
	0x0018, 0x0019, 0x001A, 0x001B, 0x001