📄 big5_to_unicode_table.h
字号:
/* * Copyright (C) 2006, Dung-Bang Tsai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * * ( If you wnat to use this library for commercial use, * feel free to contact me, just cost some money, I could sell * you the code without GPL license, so you could use this code * for your product without public your source code. ) * * Authors: * Tsai, Dung-Bang <dbtsai@gmail.com> * * 2006/03/03 at NCKU physics *//* 這是超級版的table....^_^.... 內有Big5 to Unicode的 標準版,UAO補完版,2003政府標準版,和香港HKSCS 2004版。 共支援常見的四種Big5 extension,且把相同的部份抽出來,以節省記憶體空間。 而每個區塊157字,但是我的表格每個區塊放160個字,低位元40~7E or A0~FF, 這樣查碼計算會比較方便。實際上 7F,A0,FF都不用的,所以一個區塊才只有157個字。 There are 4 functions define by (Note that the return values are UCS4, due to unsigned int = ucs4_t = 32bit ) Standard big5 table(MiscroSoft CP950), A140~F9FE (C7xx, C8xx not use) unsigned int big5_standard_to_unicode(unsigned short int input) UAO 2.5 (Unicode-at-on) big5 Extension table (http://uao.cpatch.org/), 就是中文所謂的所謂的「Unicode 補完計畫」(為standard big5的超級合) 81~A0, A3(C0~FE), C6(A1~FE)~C8, FA~FE, other is the same with standard bug5 unsigned int big5_uao_to_unicode(unsigned short int input) Big5 2003為目前台灣政府單位正式制定的最新Big5標準,詳見CNS11643附錄。 由於Big5-2003為了減少在Ambigious CJK有Unicode字寬問題, 所以它把Standard big5的某些字和符號改變位置,所以big5-2003不是Standard big5的超級合, 固共有14個字符在Unicode的位置不同,所以程式會先去找big5 2003有的部份,然後在去查詢cp950, 雖然實務上大部分的字在cp950, 先查Big5 2003會使效率降低,但這也是無可奈何的。 順便一提的是,Big5-2003把部首區的字map到Unicode的康熙字典部首區, 但是目前大多數字型都沒有實做這區。 編碼範圍: 81~A3, C2, C6,C7, F9~FE (在A1~F9內若表為0x00, 則需查stardard big5, 乃因兩者在標準字碼內有不同定義) unsigned int big5_2003_to_unicode(unsigned short int input) HKSCS 2004為目前香港政府單位正式制定的最新Big5標準。因為從2001的標準以來, 逐漸的把字從Private Use Area(PUA,用戶造字區)搬到ISO10646 CJK區段中的碼位 (extA/extB, 0x2xxxx),故表格不能用short int(UCS2)了,要用32bit的int(UCS4)才裝的下。 共有4,941個外加字(與cp950比較) 編碼範圍 87~A0, C6(A1~FE),C7,C8,F9~FE See also ISO/IEC 10646-2003(幾乎所有原來在PUA的都移到這裡, UCS4的地方) unsigned int big5_hkscs_to_unicode(unsigned short int input) by 蔡東邦 Tsai, Dung-Bang dbtsai@gmail.com 2006/03/05 at NCKU physics*/// Standard big5 table(MiscroSoft CP950), A140~F9FE (C7xx, C8xx not use)unsigned short int big5_standard_to_unicode_table[]={//This is section A1//0 1 2 3 4 5 6 7 8 9 A B C D E F0x3000,0xFF0C,0x3001,0x3002,0xFF0E,0x2027,0xFF1B,0xFF1A,0xFF1F,0xFF01,0xFE30,0x2026,0x2025,0xFE50,0xFE51,0xFE52,//40x00B7,0xFE54,0xFE55,0xFE56,0xFE57,0xFF5C,0x2013,0xFE31,0x2014,0xFE33,0x2574,0xFE34,0xFE4F,0xFF08,0xFF09,0xFE35,//50xFE36,0xFF5B,0xFF5D,0xFE37,0xFE38,0x3014,0x3015,0xFE39,0xFE3A,0x3010,0x3011,0xFE3B,0xFE3C,0x300A,0x300B,0xFE3D,//60xFE3E,0x3008,0x3009,0xFE3F,0xFE40,0x300C,0x300D,0xFE41,0xFE42,0x300E,0x300F,0xFE43,0xFE44,0xFE59,0xFE5A,0x0000,//70x0000,0xFE5B,0xFE5C,0xFE5D,0xFE5E,0x2018,0x2019,0x201C,0x201D,0x301D,0x301E,0x2035,0x2032,0xFF03,0xFF06,0xFF0A,//A0x203B,0x00A7,0x3003,0x25CB,0x25CF,0x25B3,0x25B2,0x25CE,0x2606,0x2605,0x25C7,0x25C6,0x25A1,0x25A0,0x25BD,0x25BC,//B0x32A3,0x2105,0x00AF,0xFFE3,0xFF3F,0x02CD,0xFE49,0xFE4A,0xFE4D,0xFE4E,0xFE4B,0xFE4C,0xFE5F,0xFE60,0xFE61,0xFF0B,//C0xFF0D,0x00D7,0x00F7,0x00B1,0x221A,0xFF1C,0xFF1E,0xFF1D,0x2266,0x2267,0x2260,0x221E,0x2252,0x2261,0xFE62,0xFE63,//D0xFE64,0xFE65,0xFE66,0xFF5E,0x2229,0x222A,0x22A5,0x2220,0x221F,0x22BF,0x33D2,0x33D1,0x222B,0x222E,0x2235,0x2234,//E0x2640,0x2642,0x2295,0x2299,0x2191,0x2193,0x2190,0x2192,0x2196,0x2197,0x2199,0x2198,0x2225,0x2223,0xFF0F,0x0000,//F//This is section A2//0 1 2 3 4 5 6 7 8 9 A B C D E F0xFF3C,0x2215,0xFE68,0xFF04,0xFFE5,0x3012,0xFFE0,0xFFE1,0xFF05,0xFF20,0x2103,0x2109,0xFE69,0xFE6A,0xFE6B,0x33D5,//40x339C,0x339D,0x339E,0x33CE,0x33A1,0x338E,0x338F,0x33C4,0x00B0,0x5159,0x515B,0x515E,0x515D,0x5161,0x5163,0x55E7,//50x74E9,0x7CCE,0x2581,0x2582,0x2583,0x2584,0x2585,0x2586,0x2587,0x2588,0x258F,0x258E,0x258D,0x258C,0x258B,0x258A,//60x2589,0x253C,0x2534,0x252C,0x2524,0x251C,0x2594,0x2500,0x2502,0x2595,0x250C,0x2510,0x2514,0x2518,0x256D,0x0000,//70x0000,0x256E,0x2570,0x256F,0x2550,0x255E,0x256A,0x2561,0x25E2,0x25E3,0x25E5,0x25E4,0x2571,0x2572,0x2573,0xFF10,//A0xFF11,0xFF12,0xFF13,0xFF14,0xFF15,0xFF16,0xFF17,0xFF18,0xFF19,0x2160,0x2161,0x2162,0x2163,0x2164,0x2165,0x2166,//B0x2167,0x2168,0x2169,0x3021,0x3022,0x3023,0x3024,0x3025,0x3026,0x3027,0x3028,0x3029,0x5341,0x5344,0x5345,0xFF21,//C0xFF22,0xFF23,0xFF24,0xFF25,0xFF26,0xFF27,0xFF28,0xFF29,0xFF2A,0xFF2B,0xFF2C,0xFF2D,0xFF2E,0xFF2F,0xFF30,0xFF31,//D0xFF32,0xFF33,0xFF34,0xFF35,0xFF36,0xFF37,0xFF38,0xFF39,0xFF3A,0xFF41,0xFF42,0xFF43,0xFF44,0xFF45,0xFF46,0xFF47,//E0xFF48,0xFF49,0xFF4A,0xFF4B,0xFF4C,0xFF4D,0xFF4E,0xFF4F,0xFF50,0xFF51,0xFF52,0xFF53,0xFF54,0xFF55,0xFF56,0x0000,//F//This is section A3//0 1 2 3 4 5 6 7 8 9 A B C D E F0xFF57,0xFF58,0xFF59,0xFF5A,0x0391,0x0392,0x0393,0x0394,0x0395,0x0396,0x0397,0x0398,0x0399,0x039A,0x039B,0x039C,//40x039D,0x039E,0x039F,0x03A0,0x03A1,0x03A3,0x03A4,0x03A5,0x03A6,0x03A7,0x03A8,0x03A9,0x03B1,0x03B2,0x03B3,0x03B4,//50x03B5,0x03B6,0x03B7,0x03B8,0x03B9,0x03BA,0x03BB,0x03BC,0x03BD,0x03BE,0x03BF,0x03C0,0x03C1,0x03C3,0x03C4,0x03C5,//60x03C6,0x03C7,0x03C8,0x03C9,0x3105,0x3106,0x3107,0x3108,0x3109,0x310A,0x310B,0x310C,0x310D,0x310E,0x310F,0x0000,//70x0000,0x3110,0x3111,0x3112,0x3113,0x3114,0x3115,0x3116,0x3117,0x3118,0x3119,0x311A,0x311B,0x311C,0x311D,0x311E,//A0x311F,0x3120,0x3121,0x3122,0x3123,0x3124,0x3125,0x3126,0x3127,0x3128,0x3129,0x02D9,0x02C9,0x02CA,0x02C7,0x02CB,//B0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,//C0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,//D0x0000,0x20AC,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,//E0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,//F//This is section A4//0 1 2 3 4 5 6 7 8 9 A B C D E F0x4E00,0x4E59,0x4E01,0x4E03,0x4E43,0x4E5D,0x4E86,0x4E8C,0x4EBA,0x513F,0x5165,0x516B,0x51E0,0x5200,0x5201,0x529B,//40x5315,0x5341,0x535C,0x53C8,0x4E09,0x4E0B,0x4E08,0x4E0A,0x4E2B,0x4E38,0x51E1,0x4E45,0x4E48,0x4E5F,0x4E5E,0x4E8E,//50x4EA1,0x5140,0x5203,0x52FA,0x5343,0x53C9,0x53E3,0x571F,0x58EB,0x5915,0x5927,0x5973,0x5B50,0x5B51,0x5B53,0x5BF8,//60x5C0F,0x5C22,0x5C38,0x5C71,0x5DDD,0x5DE5,0x5DF1,0x5DF2,0x5DF3,0x5DFE,0x5E72,0x5EFE,0x5F0B,0x5F13,0x624D,0x0000,//70x0000,0x4E11,0x4E10,0x4E0D,0x4E2D,0x4E30,0x4E39,0x4E4B,0x5C39,0x4E88,0x4E91,0x4E95,0x4E92,0x4E94,0x4EA2,0x4EC1,//A0x4EC0,0x4EC3,0x4EC6,0x4EC7,0x4ECD,0x4ECA,0x4ECB,0x4EC4,0x5143,0x5141,0x5167,0x516D,0x516E,0x516C,0x5197,0x51F6,//B0x5206,0x5207,0x5208,0x52FB,0x52FE,0x52FF,0x5316,0x5339,0x5348,0x5347,0x5345,0x535E,0x5384,0x53CB,0x53CA,0x53CD,//C0x58EC,0x5929,0x592B,0x592A,0x592D,0x5B54,0x5C11,0x5C24,0x5C3A,0x5C6F,0x5DF4,0x5E7B,0x5EFF,0x5F14,0x5F15,0x5FC3,//D0x6208,0x6236,0x624B,0x624E,0x652F,0x6587,0x6597,0x65A4,0x65B9,0x65E5,0x66F0,0x6708,0x6728,0x6B20,0x6B62,0x6B79,//E0x6BCB,0x6BD4,0x6BDB,0x6C0F,0x6C34,0x706B,0x722A,0x7236,0x723B,0x7247,0x7259,0x725B,0x72AC,0x738B,0x4E19,0x0000,//F//This is section A5//0 1 2 3 4 5 6 7 8 9 A B C D E F0x4E16,0x4E15,0x4E14,0x4E18,0x4E3B,0x4E4D,0x4E4F,0x4E4E,0x4EE5,0x4ED8,0x4ED4,0x4ED5,0x4ED6,0x4ED7,0x4EE3,0x4EE4,//40x4ED9,0x4EDE,0x5145,0x5144,0x5189,0x518A,0x51AC,0x51F9,0x51FA,0x51F8,0x520A,0x52A0,0x529F,0x5305,0x5306,0x5317,//50x531D,0x4EDF,0x534A,0x5349,0x5361,0x5360,0x536F,0x536E,0x53BB,0x53EF,0x53E4,0x53F3,0x53EC,0x53EE,0x53E9,0x53E8,//60x53FC,0x53F8,0x53F5,0x53EB,0x53E6,0x53EA,0x53F2,0x53F1,0x53F0,0x53E5,0x53ED,0x53FB,0x56DB,0x56DA,0x5916,0x0000,//70x0000,0x592E,0x5931,0x5974,0x5976,0x5B55,0x5B83,0x5C3C,0x5DE8,0x5DE7,0x5DE6,0x5E02,0x5E03,0x5E73,0x5E7C,0x5F01,//A0x5F18,0x5F17,0x5FC5,0x620A,0x6253,0x6254,0x6252,0x6251,0x65A5,0x65E6,0x672E,0x672C,0x672A,0x672B,0x672D,0x6B63,//B
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -