#include "strnormalize.h"
#include <stdlib.h>
#define SWAPBYTE(x) (((unsigned short)(x) >> 8) | (unsigned short)(x) << 8)
#define COMPBYTE(x, y) ((unsigned char)(x) << 8 | (unsigned char)(y))
static const unsigned short *_pTrad2Simp_gbk;
static const unsigned short *_pTrad2Simp_utf16;
static const unsigned short *_pPlain_gbk;
static const unsigned short *_pPlain_utf16;
static const char *_pUpper2Lower;
static const char *_pLower2Upper;
static const char *_pPlain;
static const unsigned short *_pGbk2Utf16;
static const unsigned short *_pUtf162Gbk;
static const unsigned short *_pTns;
static unsigned short _tns_size;
static const unsigned short *_pGbk2utf16_2;
static unsigned short _gbk2utf16_2_size;
static const unsigned short *_pGbk2utf16_3;
static unsigned short _gbk2utf16_3_size;
const unsigned short *_initTns();
const unsigned short *_initGbk2utf16_2();
const unsigned short *_initGbk2utf16_3();
const unsigned short *_initTrad2Simp_utf16();
const unsigned short *_initTrad2Simp_gbk();
const unsigned short *_initPlain_utf16();
const unsigned short *_initPlain_gbk();
const char *_initUpper2Lower();
const char *_initLower2Upper();
const char *_initPlain();
const unsigned short *_initGbk2Utf16();
const unsigned short *_initUtf162Gbk();
void str_normalize_init()
{
_pTns = _initTns();
_pGbk2utf16_2 = _initGbk2utf16_2();
_pGbk2utf16_3 = _initGbk2utf16_3();
_pTrad2Simp_gbk = _initTrad2Simp_gbk();
_pTrad2Simp_utf16 = _initTrad2Simp_utf16();
_pPlain_gbk = _initPlain_gbk();
_pPlain_utf16 = _initPlain_utf16();
_pUpper2Lower = _initUpper2Lower();
_pLower2Upper = _initLower2Upper();
_pPlain = _initPlain();
_pGbk2Utf16 = _initGbk2Utf16();
_pUtf162Gbk = _initUtf162Gbk();
}
const unsigned short *_initTns()
{
static const unsigned short _tns[] =
{
0x8147 /* 丟 */, 0xB6AA /* 丢 */, // {{{ Simplified-Traditional table
0x814B /* 並 */, 0xB2A2 /* 并 */,
0x8179 /* 亂 */, 0xC2D2 /* 乱 */,
0x8183 /* 亙 */, 0xD8A8 /* 亘 */,
0x8186 /* 亞 */, 0xD1C7 /* 亚 */,
0x81B2 /* 伈 */, 0xD0C4 /* 心 */,
0x81B8 /* 伕 */, 0xB7F2 /* 夫 */,
0x81D0 /* 佇 */, 0xD8F9 /* 伫 */,
0x81D1 /* 佈 */, 0xB2BC /* 布 */,
0x81D7 /* 佔 */, 0xD5BC /* 占 */,
0x81E3 /* 併 */, 0xB2A2 /* 并 */,
0x81ED /* 來 */, 0xC0B4 /* 来 */,
0x81F6 /* 侖 */, 0xC2D8 /* 仑 */,
0x81F9 /* 侚 */, 0xE1DF /* 徇 */,
0x8248 /* 侶 */, 0xC2C2 /* 侣 */,
0x8249 /* 侷 */, 0xBED6 /* 局 */,
0x8252 /* 俁 */, 0xD9B6 /* 俣 */,
0x8253 /* 係 */, 0xCFB5 /* 系 */,
0x8262 /* 俠 */, 0xCFC0 /* 侠 */,
0x826C /* 俵 */, 0xB1ED /* 表 */,
0x8274 /* 倀 */, 0xD8F6 /* 伥 */,
0x827A /* 倆 */, 0xC1A9 /* 俩 */,
0x827D /* 倉 */, 0xB2D6 /* 仓 */,
0x8280 /* 個 */, 0xB8F6 /* 个 */,
0x8283 /* 們 */, 0xC3C7 /* 们 */,
0x8286 /* 倖 */, 0xD0D2 /* 幸 */,
0x828D /* 倣 */, 0xB7C2 /* 仿 */,
0x8290 /* 倫 */, 0xC2D7 /* 伦 */,
0x82A5 /* 偉 */, 0xCEB0 /* 伟 */,
0x82BF /* 偪 */, 0xB1C6 /* 逼 */,
0x82C8 /* 側 */, 0xB2E0 /* 侧 */,
0x82C9 /* 偵 */, 0xD5EC /* 侦 */,
0x82CA /* 偸 */, 0xCDB5 /* 偷 */,
0x82CC /* 偺 */, 0xD4DB /* 咱 */,
0x82CE /* 偽 */, 0xCEB1 /* 伪 */,
0x82DC /* 傑 */, 0xBDDC /* 杰 */,
0x82E1 /* 傖 */, 0xD8F7 /* 伧 */,
0x82E3 /* 傘 */, 0xC9A1 /* 伞 */,
0x82E4 /* 備 */, 0xB1B8 /* 备 */,
0x82E5 /* 傚 */, 0xD0A7 /* 效 */,
0x82ED /* 傢 */, 0xBCD2 /* 家 */,
0x82F2 /* 傭 */, 0xD3B6 /* 佣 */,
0x82F4 /* 傯 */, 0xD9CC /* 偬 */,
0x82F7 /* 傳 */, 0xB4AB /* 传 */,
0x82F8 /* 傴 */, 0xD8F1 /* 伛 */,
0x82F9 /* 債 */, 0xD5AE /* 债 */,
0x82FB /* 傷 */, 0xC9CB /* 伤 */,
0x8341 /* 傾 */, 0xC7E3 /* 倾 */,
0x8345 /* 僂 */, 0xD9CD /* 偻 */,
0x8348 /* 僅 */, 0xBDF6 /* 仅 */,
0x834C /* 僉 */, 0xD9DD /* 佥 */,
0x834D /* 僊 */, 0xCFC9 /* 仙 */,
0x8353 /* 僑 */, 0xC7C8 /* 侨 */,
0x8357 /* 僕 */, 0xC6CD /* 仆 */,
0x835E /* 僞 */, 0xCEB1 /* 伪 */,
0x8365 /* 僥 */, 0xBDC4 /* 侥 */,
0x8366 /* 僨 */, 0xD9C7 /* 偾 */,
0x836C /* 僱 */, 0xB9CD /* 雇 */,
0x8372 /* 價 */, 0xBCDB /* 价 */,
0x8378 /* 儀 */, 0xD2C7 /* 仪 */,
0x837A /* 儂 */, 0xD9AF /* 侬 */,
0x837C /* 億 */, 0xD2DA /* 亿 */,
0x837D /* 儅 */, 0xB5B1 /* 当 */,
0x837E /* 儈 */, 0xBFEB /* 侩 */,
0x8380 /* 儉 */, 0xBCF3 /* 俭 */,
0x8386 /* 儐 */, 0xD9CF /* 傧 */,
0x8389 /* 儔 */, 0xD9B1 /* 俦 */,
0x838A /* 儕 */, 0xD9AD /* 侪 */,
0x838D /* 儘 */, 0xBEA1 /* 尽 */,
0x8394 /* 償 */, 0xB3A5 /* 偿 */,
0x839E /* 優 */, 0xD3C5 /* 优 */,
0x83A6 /* 儲 */, 0xB4A2 /* 储 */,
0x83A7 /* 儳 */, 0xB2F6 /* 馋 */,
0x83AB /* 儷 */, 0xD9B3 /* 俪 */,
0x83AC /* 儸 */, 0xC2DE /* 罗 */,
0x83AD /* 儹 */, 0xD4DC /* 攒 */,
0x83AE /* 儺 */, 0xD9D0 /* 傩 */,
0x83AF /* 儻 */, 0xD9CE /* 傥 */,
0x83B0 /* 儼 */, 0xD9B2 /* 俨 */,
0x83B4 /* 兇 */, 0xD0D7 /* 凶 */,
0x83B6 /* 兌 */, 0xB6D2 /* 兑 */,
0x83BA /* 兒 */, 0xB6F9 /* 儿 */,
0x83BC /* 兗 */, 0xD9F0 /* 兖 */,
0x83C8 /* 內 */, 0xC4DA /* 内 */,
0x83C9 /* 兩 */, 0xC1BD /* 两 */,
0x83D4 /* 冊 */, 0xB2E1 /* 册 */,
0x83D9 /* 冑 */, 0xEBD0 /* 胄 */,
0x83E7 /* 冪 */, 0xC3DD /* 幂 */,
0x83F2 /* 凃 */, 0xCDBF /* 涂 */,
0x83F3 /* 凅 */, 0xB9CC /* 固 */,
0x83F4 /* 凈 */, 0xBEBB /* 净 */,
0x83F6 /* 凍 */, 0xB6B3 /* 冻 */,
0x8443 /* 凜 */, 0xC1DD /* 凛 */,
0x8445 /* 凟 */, 0xE4C2 /* 渎 */,
0x8449 /* 処 */, 0xB4A6 /* 处 */,
0x8450 /* 凱 */, 0xBFAD /* 凯 */,
0x8452 /* 凴 */, 0xC6BE /* 凭 */,
0x8465 /* 別 */, 0xB1F0 /* 别 */,
0x8468 /* 刪 */, 0xC9BE /* 删 */,
0x8471 /* 剄 */, 0xD8D9 /* 刭 */,
0x8474 /* 則 */, 0xD4F2 /* 则 */,
0x8476 /* 剉 */, 0xEFB1 /* 锉 */,
0x8477 /* 剋 */, 0xBFCB /* 克 */,
0x8478 /* 剎 */, 0xC9B2 /* 刹 */,
0x847D /* 剗 */, 0x8469 /* 刬 */,
0x8482 /* 剛 */, 0xB8D5 /* 刚 */,
0x8483 /* 剝 */, 0xB0FE /* 剥 */,
0x848E /* 剮 */, 0xB9D0 /* 剐 */,
0x8492 /* 剴 */, 0xD8DC /* 剀 */,
0x8493 /* 創 */, 0xB4B4 /* 创 */,
0x8495 /* 剷 */, 0xB2F9 /* 铲 */,
0x849D /* 劃 */, 0xBBAE /* 划 */,
0x849E /* 劄 */, 0xD4FD /* 札 */,
0x84A1 /* 劇 */, 0xBEE7 /* 剧 */,
0x84A2 /* 劉 */, 0xC1F5 /* 刘 */,
0x84A3 /* 劊 */, 0xB9F4 /* 刽 */,
0x84A5 /* 劌 */, 0xD8DB /* 刿 */,
0x84A6 /* 劍 */, 0xBDA3 /* 剑 */,
0x84A9 /* 劑 */, 0xBCC1 /* 剂 */,
0x84AA /* 劒 */, 0xBDA3 /* 剑 */,
0x84C5 /* 勁 */, 0xBEA2 /* 劲 */,
0x84CD /* 勍 */, 0xC7E6 /* 擎 */,
0x84D3 /* 動 */, 0xB6AF /* 动 */,
0x84D4 /* 勗 */, 0xDBC3 /* 勖 */,
0x84D5 /* 務 */, 0xCEF1 /* 务 */,
0x84D7 /* 勛 */, 0xD1AB /* 勋 */,
0x84D9 /* 勝 */, 0xCAA4 /* 胜 */,
0x84DA /* 勞 */, 0xC0CD /* 劳 */,
0x84DD /* 勢 */, 0xCAC6 /* 势 */,
0x84DE /* 勣 */, 0xBCA8 /* 绩 */,
0x84E0 /* 勦 */, 0xBDCB /* 剿 */,
0x84E3 /* 勩 */, 0x84D6 /* 勚 */,
0x84EA /* 勱 */, 0xDBBD /* 劢 */,
0x84EC /* 勳 */, 0xD1AB /* 勋 */,
0x84EE /* 勵 */, 0xC0F8 /* 励 */,
0x84F1 /* 勸 */, 0xC8B0 /* 劝 */,
0x84F2 /* 勻 */, 0xD4C8 /* 匀 */,
0x84FC /* 匋 */, 0xCCD5 /* 陶 */,
0x8551 /* 匭 */, 0xD8D0 /* 匦 */,
0x8552 /* 匯 */, 0xBBE3 /* 汇 */,
0x8554 /* 匱 */, 0xD8D1 /* 匮 */,
0x8555 /* 匲 */, 0xDEC6 /* 奁 */,
0x8556 /* 匳 */, 0xDEC6 /* 奁 */,
0x8558 /* 匵 */, 0xE8FC /* 椟 */,
0x855E /* 區 */, 0xC7F8 /* 区 */,
0x8564 /* 卍 */, 0xCDF2 /* 万 */,
0x8566 /* 協 */, 0xD0AD /* 协 */,
0x856E /* 卬 */, 0xB0BA /* 昂 */,
0x8572 /* 卹 */, 0xD0F4 /* 恤 */,
0x8573 /* 卻 */, 0xC8B4 /* 却 */,
0x8587 /* 厙 */, 0xD8C7 /* 厍 */,
0x8588 /* 厛 */, 0xCCFC /* 厅 */,
0x858B /* 厠 */, 0xB2DE /* 厕 */,
0x858D /* 厤 */, 0xC0FA /* 历 */,
0x8592 /* 厭 */, 0xD1E1 /* 厌 */,
0x8594 /* 厰 */, 0xB3A7 /* 厂 */,
0x8596 /* 厲 */, 0xC0F7 /* 厉 */,
0x8598 /* 厴 */, 0xD8C9 /* 厣 */,
0x85A2 /* 參 */, 0xB2CE /* 参 */,
0x85B2 /* 叢 */, 0xB4D4 /* 丛 */,
0x85BC /* 吋 */, 0x