/*
*
* GBK转换到UTF8的查找表。
* 这个表内每个单元占3个字节,这三个字节就是GBK码对应的UTF8码。
* 因此这个表也遵守GBK字库的寻址公式:((lead - 0x81) * 191) + (trail - 0x40)
*
*/
static const unsigned char gbk_2_utf8_table[][3] =
{
{0xE4, 0xB8, 0x82},
{0xE4, 0xB8, 0x84},
{0xE4, 0xB8, 0x85},
{0xE4, 0xB8, 0x86},
{0xE4, 0xB8, 0x8F},
{0xE4, 0xB8, 0x92},
{0xE4, 0xB8, 0x97},
{0xE4, 0xB8, 0x9F},
{0xE4, 0xB8, 0xA0},
{0xE4, 0xB8, 0xA1},
{0xE4, 0xB8, 0xA3},
{0xE4, 0xB8, 0xA6},
{0xE4, 0xB8, 0xA9},
{0xE4, 0xB8, 0xAE},
{0xE4, 0xB8, 0xAF},
{0xE4, 0xB8, 0xB1},
{0xE4, 0xB8, 0xB3},
{0xE4, 0xB8, 0xB5},
{0xE4, 0xB8, 0xB7},
{0xE4, 0xB8, 0xBC},
{0xE4, 0xB9, 0x80},
{0xE4, 0xB9, 0x81},
{0xE4, 0xB9, 0x82},
{0xE4, 0xB9, 0x84},
{0xE4, 0xB9, 0x86},
{0xE4, 0xB9, 0x8A},
{0xE4, 0xB9, 0x91},
{0xE4, 0xB9, 0x95},
{0xE4, 0xB9, 0x97},
{0xE4, 0xB9, 0x9A},
{0xE4, 0xB9, 0x9B},
{0xE4, 0xB9, 0xA2},
{0xE4, 0xB9, 0xA3},
{0xE4, 0xB9, 0xA4},
{0xE4, 0xB9, 0xA5},
{0xE4, 0xB9, 0xA7},
{0xE4, 0xB9, 0xA8},
{0xE4, 0xB9, 0xAA},
{0xE4, 0xB9, 0xAB},
{0xE4, 0xB9, 0xAC},
{0xE4, 0xB9, 0xAD},
{0xE4, 0xB9, 0xAE},
{0xE4, 0xB9, 0xAF},
{0xE4, 0xB9, 0xB2},
{0xE4, 0xB9, 0xB4},
{0xE4, 0xB9, 0xB5},
{0xE4, 0xB9, 0xB6},
{0xE4, 0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xE4, 0xBF, 0x87},
{0xE4, 0xBF, 0x88},
{0xE4, 0xBF, 0x89},
{0xE4, 0xBF, 0x8B},
{0xE4, 0xBF, 0x8C},
{0xE4, 0xBF, 0x8D},
{0xE4, 0xBF, 0x92},
{0xE4, 0xBF, 0x93},
{0xE4, 0xBF, 0x94},
{0xE4, 0xBF, 0x95},
{0xE4, 0xBF, 0x96},
{0xE4, 0xBF, 0x99},
{0xE4, 0xBF, 0x9B},
{0xE4, 0xBF, 0xA0},
{0xE4, 0xBF, 0xA2},
{0xE4, 0xBF, 0xA4},
{0xE4, 0xBF, 0xA5},
{0xE4, 0xBF, 0xA7},
{0xE4, 0xBF, 0xAB},
{0xE4, 0xBF, 0xAC},
{0xE4, 0xBF, 0xB0},
{0xE4, 0xBF, 0xB2},
{0xE4, 0xBF, 0xB4},
{0xE4, 0xBF, 0xB5},
{0xE4, 0xBF, 0xB6},
{0xE4, 0xBF, 0xB7},
{0xE4, 0xBF, 0xB9},
{0xE4, 0xBF, 0xBB},
{0xE4, 0xBF, 0xBC},
{0xE4, 0xBF, 0xBD},
{0xE4, 0xBF, 0xBF},
{0xE5, 0x80, 0x80},
{0xE5, 0x80, 0x81},
{0xE5, 0x80, 0x82},
{0xE5, 0x80, 0x83},
{0xE5, 0x80, 0x84},
{0xE5, 0x80, 0x85},
{0xE5, 0x80, 0x86},
{0xE5, 0x80, 0x87},
{0xE5, 0x80, 0x88},
{0xE5, 0x80, 0x89},
{0xE5, 0x80, 0x8A},
{0x3F, 0x00, 0x00},
{0xE5, 0x80, 0x8B},
{0xE5, 0x80, 0x8E},
{0xE5, 0x80, 0x90},
{0xE5, 0x80, 0x91},
{0xE5, 0x80, 0x93},
{0xE5, 0x80, 0x95},
{0xE5, 0x80, 0x96},
{0xE5, 0x80, 0x97},
{0xE5, 0x80, 0x9B},
{0xE5, 0x80, 0x9D},
{0xE5, 0x80, 0x9E},
{0xE5, 0x80, 0xA0},
{0xE5, 0x80, 0xA2},
{0xE5, 0x80, 0xA3},
{0xE5, 0x80, 0xA4},
{0xE5, 0x80, 0xA7},
{0xE5, 0x80, 0xAB},
{0xE5, 0x80, 0xAF},
{0xE5, 0x80, 0xB0},
{0xE5, 0x80, 0xB1},
{0xE5, 0x80, 0xB2},
{0xE5, 0x80, 0xB3},
{0xE5, 0x80, 0xB4},
{0xE5, 0x80, 0xB5},
{0xE5, 0x80, 0xB6},
{0xE5, 0x80, 0xB7},
{0xE5, 0x80, 0xB8},
{0xE5, 0x80, 0xB9},
{0xE5, 0x80, 0xBB},
{0xE5, 0x80, 0xBD},
{0xE5, 0x80, 0xBF},
{0xE5, 0x81, 0x80},
{0xE5, 0x81, 0x81},
{0xE5, 0x81, 0x82},
{0xE5, 0x81, 0x84},
{0xE5, 0x81, 0x85},
{0xE5, 0x81, 0x86},
{0xE5, 0x81, 0x89},
{0xE5, 0x81, 0x8A},
{0xE5, 0x81, 0x8B},
{0xE5, 0x81, 0x8D},
{0xE5, 0x81, 0x90},
{0xE5, 0x81, 0x91},
{0xE5, 0x81, 0x92},
{0xE5, 0x81, 0x93},
{0xE5, 0x81, 0x94},
{0xE5, 0x81, 0x96},
{0xE5, 0x81, 0x97},
{0xE5, 0x81, 0x98},
{0xE5, 0x81, 0x99},
{0xE5, 0x81, 0x9B},
{0xE5, 0x81, 0x9D},
{0xE5, 0x81, 0x9E},
{0xE5, 0x81, 0x9F},
{0xE5, 0x81, 0xA0},
{0xE5, 0x81, 0xA1},
{0xE5, 0x81, 0xA2},
{0xE5, 0x81, 0xA3},
{0xE5, 0x81, 0xA4},
{0xE5, 0x81, 0xA6},
{0xE5, 0x81, 0xA7},
{0xE5, 0x81, 0xA8},
{0xE5, 0x81, 0xA9},
{0xE5, 0x81, 0xAA},
{0xE5, 0x81, 0xAB},
{0xE5, 0x81, 0xAD},
{0xE5, 0x81, 0xAE},
{0xE5, 0x81, 0xAF},
{0xE5, 0x81, 0xB0},
{0xE5, 0x81, 0xB1},
{0xE5, 0x81, 0xB2},
{0xE5, 0x81, 0xB3},
{0xE5, 0x81, 0xB4},
{0xE5, 0x81, 0xB5},
{0xE5, 0x81, 0xB8},
{0xE5, 0x81, 0xB9},
{0xE5, 0x81, 0xBA},
{0xE5, 0x81, 0xBC},
{0xE5, 0x81, 0xBD},
{0xE5, 0x82, 0x81},
{0xE5, 0x82, 0x82},
{0xE5, 0x82, 0x83},
{0xE5, 0x82, 0x84},
{0xE5, 0x82, 0x86},
{0xE5, 0x82, 0x87},
{0xE5, 0x82, 0x89},
{0xE5, 0x82, 0x8A},
{0xE5, 0x82, 0x8B},
{0xE5, 0x82, 0x8C},
{0xE5, 0x82, 0x8E},
{0xE5, 0x82, 0x8F},
{0xE5, 0x82, 0x90},
{0xE5, 0x82, 0x91},
{0xE5, 0x82, 0x92},
{0xE5, 0x82, 0x93},
{0xE5, 0x82, 0x94},
{0xE5, 0x82, 0x95},
{0xE5, 0x82, 0x96},
{0xE5, 0x82, 0x97},
{0xE5, 0x82, 0x98},
{0xE5, 0x82, 0x99},
{0xE5, 0x82, 0x9A},
{0xE5, 0x82, 0x9B},
{0xE5, 0x82, 0x9C},
{0xE5, 0x82, 0x9D},
{0xE5, 0x82, 0x9E},
{0xE5, 0x82, 0x9F},
{0xE5, 0x82, 0xA0},
{0xE5, 0x82, 0xA1},
{0xE5, 0x82, 0xA2},
{0xE5, 0x82, 0xA4},
{0xE5, 0x82, 0xA6},
{0xE5, 0x82, 0xAA},
{0xE5, 0x82, 0xAB},
{0xE5, 0