dclib-utf8.c 62 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257
  1. /***************************************************************************
  2. * *
  3. * _____ ____ *
  4. * | __ \ / __ \ _ _ _____ *
  5. * | | \ \ / / \_\ | | | | _ \ *
  6. * | | \ \| | | | | | |_| | *
  7. * | | | || | | | | | ___/ *
  8. * | | / /| | __ | | | | _ \ *
  9. * | |__/ / \ \__/ / | |___| | |_| | *
  10. * |_____/ \____/ |_____|_|_____/ *
  11. * *
  12. * Wiimms source code library *
  13. * *
  14. ***************************************************************************
  15. * *
  16. * Copyright (c) 2012-2022 by Dirk Clemens <wiimm@wiimm.de> *
  17. * *
  18. ***************************************************************************
  19. * *
  20. * This library is free software; you can redistribute it and/or modify *
  21. * it under the terms of the GNU General Public License as published by *
  22. * the Free Software Foundation; either version 2 of the License, or *
  23. * (at your option) any later version. *
  24. * *
  25. * This library is distributed in the hope that it will be useful, *
  26. * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  27. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  28. * GNU General Public License for more details. *
  29. * *
  30. * See file gpl-2.0.txt or http://www.gnu.org/licenses/gpl-2.0.txt *
  31. * *
  32. ***************************************************************************/
  33. #define _GNU_SOURCE 1
  34. #include <string.h>
  35. #include <limits.h>
  36. #include <arpa/inet.h>
  37. #include "dclib-basics.h"
  38. #include "dclib-debug.h"
  39. #include "dclib-utf8.h"
  40. ///////////////////////////////////////////////////////////////////////////////
  41. ///////////////////////////////////////////////////////////////////////////////
  42. #define u0 DC_UTF8_ILLEGAL
  43. #define u1 DC_UTF8_1CHAR
  44. #define u2 DC_UTF8_2CHAR
  45. #define u3 DC_UTF8_3CHAR
  46. #define u4 DC_UTF8_4CHAR
  47. #define uc DC_UTF8_CONT_ANY
  48. const unsigned short TableUTF8Mode[256] =
  49. {
  50. u1,u1,u1,u1, u1,u1,u1,u1, u1,u1,u1,u1, u1,u1,u1,u1, // 0000xxxx
  51. u1,u1,u1,u1, u1,u1,u1,u1, u1,u1,u1,u1, u1,u1,u1,u1, // 0001xxxx
  52. u1,u1,u1,u1, u1,u1,u1,u1, u1,u1,u1,u1, u1,u1,u1,u1, // 0010xxxx
  53. u1,u1,u1,u1, u1,u1,u1,u1, u1,u1,u1,u1, u1,u1,u1,u1, // 0011xxxx
  54. u1,u1,u1,u1, u1,u1,u1,u1, u1,u1,u1,u1, u1,u1,u1,u1, // 0100xxxx
  55. u1,u1,u1,u1, u1,u1,u1,u1, u1,u1,u1,u1, u1,u1,u1,u1, // 0101xxxx
  56. u1,u1,u1,u1, u1,u1,u1,u1, u1,u1,u1,u1, u1,u1,u1,u1, // 0110xxxx
  57. u1,u1,u1,u1, u1,u1,u1,u1, u1,u1,u1,u1, u1,u1,u1,u1, // 0111xxxx
  58. uc,uc,uc,uc, uc,uc,uc,uc, uc,uc,uc,uc, uc,uc,uc,uc, // 1000xxxx
  59. uc,uc,uc,uc, uc,uc,uc,uc, uc,uc,uc,uc, uc,uc,uc,uc, // 1001xxxx
  60. uc,uc,uc,uc, uc,uc,uc,uc, uc,uc,uc,uc, uc,uc,uc,uc, // 1010xxxx
  61. uc,uc,uc,uc, uc,uc,uc,uc, uc,uc,uc,uc, uc,uc,uc,uc, // 1011xxxx
  62. u2,u2,u2,u2, u2,u2,u2,u2, u2,u2,u2,u2, u2,u2,u2,u2, // 1100xxxx
  63. u2,u2,u2,u2, u2,u2,u2,u2, u2,u2,u2,u2, u2,u2,u2,u2, // 1101xxxx
  64. u3,u3,u3,u3, u3,u3,u3,u3, u3,u3,u3,u3, u3,u3,u3,u3, // 1110xxxx
  65. u4,u4,u4,u4, u4,u4,u4,u4, u0,u0,u0,u0, u0,u0,u0,u0 // 1111xxxx
  66. };
  67. #undef u0
  68. #undef u1
  69. #undef u2
  70. #undef u3
  71. #undef u4
  72. #undef uc
  73. ///////////////////////////////////////////////////////////////////////////////
  74. #define CheckUTF8Mode(ch) ((dcUTF8Mode)TableUTF8Mode[(unsigned char)(ch)])
  75. ///////////////////////////////////////////////////////////////////////////////
  76. int GetUTF8CharLength ( u32 code )
  77. {
  78. // returns the length of the char 'code'
  79. // 0 : illegal code
  80. return code <= DCLIB_UNICODE_MAX_UTF8_1
  81. ? 1
  82. : code <= DCLIB_UNICODE_MAX_UTF8_2
  83. ? 2
  84. : code <= DCLIB_UNICODE_MAX_UTF8_3
  85. ? 3
  86. : code <= DCLIB_UNICODE_MAX_UTF8_4
  87. ? 4
  88. : 0;
  89. }
  90. ///////////////////////////////////////////////////////////////////////////////
  91. char * NextUTF8Char ( ccp ptr )
  92. {
  93. // goto next UTF8 character
  94. switch (CheckUTF8Mode(*ptr))
  95. {
  96. case DC_UTF8_1CHAR:
  97. return *ptr ? (char*)ptr+1 : (char*)ptr;
  98. case DC_UTF8_4CHAR:
  99. if ( CheckUTF8Mode(*++ptr) != DC_UTF8_CONT_ANY )
  100. break;
  101. // fall through
  102. case DC_UTF8_3CHAR:
  103. case DC_UTF8_CONT_ANY:
  104. if ( CheckUTF8Mode(*++ptr) != DC_UTF8_CONT_ANY )
  105. break;
  106. // fall through
  107. case DC_UTF8_2CHAR:
  108. if ( CheckUTF8Mode(*++ptr) != DC_UTF8_CONT_ANY )
  109. break;
  110. // fall through
  111. default: // DC_UTF8_ILLEGAL
  112. return (char*)ptr+1;
  113. }
  114. return (char*)ptr;
  115. }
  116. //-----------------------------------------------------------------------------
  117. char * NextUTF8CharE( ccp ptr, ccp end )
  118. {
  119. // goto next UTF8 character
  120. if ( ptr >= end )
  121. return (char*)end;
  122. switch (CheckUTF8Mode(*ptr))
  123. {
  124. case DC_UTF8_1CHAR:
  125. return (char*)ptr+1;
  126. case DC_UTF8_4CHAR:
  127. if ( ++ptr >= end || CheckUTF8Mode(*ptr) != DC_UTF8_CONT_ANY )
  128. break;
  129. // fall through
  130. case DC_UTF8_3CHAR:
  131. case DC_UTF8_CONT_ANY:
  132. if ( ++ptr >= end || CheckUTF8Mode(*ptr) != DC_UTF8_CONT_ANY )
  133. break;
  134. // fall through
  135. case DC_UTF8_2CHAR:
  136. if ( ++ptr >= end || CheckUTF8Mode(*ptr) != DC_UTF8_CONT_ANY )
  137. break;
  138. // fall through
  139. default: // DC_UTF8_ILLEGAL
  140. return (char*)ptr+1;
  141. }
  142. return (char*)ptr;
  143. }
  144. ///////////////////////////////////////////////////////////////////////////////
  145. char * NextEUTF8Char ( ccp ptr )
  146. {
  147. return NextUTF8Char(SkipEscapes(ptr));
  148. }
  149. //-----------------------------------------------------------------------------
  150. char * NextEUTF8CharE ( ccp ptr, ccp end )
  151. {
  152. return NextUTF8CharE(SkipEscapesE(ptr,end),end);
  153. }
  154. ///////////////////////////////////////////////////////////////////////////////
  155. char * PrevUTF8Char ( ccp str )
  156. {
  157. // go to the previous UTC character
  158. // kleine Optimierung für den Standardfall
  159. if ( (uchar)str[-1] < (uint)DCLIB_UNICODE_MAX_UTF8_1 )
  160. return (char*)str-1;
  161. ccp ptr = str;
  162. int n = 0;
  163. dcUTF8Mode mode = CheckUTF8Mode(*--ptr);
  164. while ( n < 3 && mode == DC_UTF8_CONT_ANY )
  165. {
  166. n++;
  167. mode = CheckUTF8Mode(*--ptr);
  168. }
  169. switch (mode)
  170. {
  171. case DC_UTF8_1CHAR:
  172. return (char*)( n<1 ? ptr : ptr+1 );
  173. case DC_UTF8_2CHAR:
  174. return (char*)( n<2 ? ptr : ptr+2 );
  175. case DC_UTF8_3CHAR:
  176. return (char*)( n<3 ? ptr : ptr+3 );
  177. case DC_UTF8_4CHAR:
  178. return (char*)( n<4 ? ptr : ptr+4 );
  179. case DC_UTF8_CONT_ANY:
  180. return (char*)str-3;
  181. default:
  182. return (char*)str-1;
  183. }
  184. }
  185. //-----------------------------------------------------------------------------
  186. char * PrevUTF8CharB ( ccp str, ccp begin )
  187. {
  188. // go to the previous UTC character
  189. ccp ptr = str;
  190. if ( ptr <= begin )
  191. return (char*)begin;
  192. // kleine Optimierung für den Standardfall
  193. if ( (uchar)ptr[-1] < (uint)DCLIB_UNICODE_MAX_UTF8_1 )
  194. return (char*)ptr-1;
  195. int n = 0;
  196. dcUTF8Mode mode = CheckUTF8Mode(*--ptr);
  197. while ( ptr > begin && n < 3 && mode == DC_UTF8_CONT_ANY )
  198. {
  199. n++;
  200. mode = CheckUTF8Mode(*--ptr);
  201. }
  202. switch (mode)
  203. {
  204. case DC_UTF8_1CHAR:
  205. return (char*)( n<1 ? ptr : ptr+1 );
  206. case DC_UTF8_2CHAR:
  207. return (char*)( n<2 ? ptr : ptr+2 );
  208. case DC_UTF8_3CHAR:
  209. return (char*)( n<3 ? ptr : ptr+3 );
  210. case DC_UTF8_4CHAR:
  211. return (char*)( n<4 ? ptr : ptr+4 );
  212. case DC_UTF8_CONT_ANY:
  213. return (char*)str-3;
  214. default:
  215. return (char*)str-1;
  216. }
  217. }
  218. ///////////////////////////////////////////////////////////////////////////////
  219. char * SkipUTF8Char ( ccp str, int skip )
  220. {
  221. if (str)
  222. {
  223. if ( skip < 0 )
  224. skip += ScanUTF8Length(str);
  225. while ( skip-- > 0 )
  226. {
  227. ccp next = NextUTF8Char(str);
  228. if ( str == next )
  229. break;
  230. str = next;
  231. }
  232. }
  233. return (char*)str;
  234. }
  235. //-----------------------------------------------------------------------------
  236. char * SkipUTF8CharE ( ccp str, ccp end, int skip )
  237. {
  238. if (str)
  239. {
  240. if ( skip < 0 )
  241. skip += ScanUTF8LengthE(str,end);
  242. while ( skip-- > 0 )
  243. {
  244. ccp next = NextUTF8CharE(str,end);
  245. if ( str == next )
  246. break;
  247. str = next;
  248. }
  249. }
  250. return (char*)str;
  251. }
  252. //-----------------------------------------------------------------------------
  253. char * SkipEUTF8Char ( ccp str, int skip )
  254. {
  255. if (str)
  256. {
  257. if ( skip < 0 )
  258. skip += ScanEUTF8Length(str);
  259. while ( skip-- > 0 )
  260. {
  261. ccp next = NextEUTF8Char(str);
  262. if ( str == next )
  263. break;
  264. str = next;
  265. }
  266. }
  267. return (char*)str;
  268. }
  269. //-----------------------------------------------------------------------------
  270. char * SkipEUTF8CharE ( ccp str, ccp end, int skip )
  271. {
  272. if (str)
  273. {
  274. if ( skip < 0 )
  275. skip += ScanEUTF8LengthE(str,end);
  276. while ( skip-- > 0 )
  277. {
  278. ccp next = NextEUTF8CharE(str,end);
  279. if ( str == next )
  280. break;
  281. str = next;
  282. }
  283. }
  284. return (char*)str;
  285. }
  286. ///////////////////////////////////////////////////////////////////////////////
  287. u32 GetUTF8Char ( ccp str )
  288. {
  289. // fast scan of a UTF8 char -> ignore errors in continuation bytes
  290. const u32 result = (uchar)*str;
  291. switch (CheckUTF8Mode(result))
  292. {
  293. case DC_UTF8_1CHAR:
  294. return result;
  295. case DC_UTF8_2CHAR:
  296. return ( result & 0x1f ) << 6
  297. | ( str[1] & 0x3f );
  298. case DC_UTF8_3CHAR:
  299. return ( result & 0x0f ) << 12
  300. | ( str[1] & 0x3f ) << 6
  301. | ( str[2] & 0x3f );
  302. case DC_UTF8_4CHAR:
  303. return ( result & 0x07 ) << 18
  304. | ( str[1] & 0x3f ) << 12
  305. | ( str[2] & 0x3f ) << 6
  306. | ( str[3] & 0x3f );
  307. case DC_UTF8_CONT_ANY:
  308. return ( result & 0x3f ) << 12
  309. | ( str[1] & 0x3f ) << 6
  310. | ( str[2] & 0x3f );
  311. default: // DC_UTF8_ILLEGAL
  312. return result & 0x7f | S32_MIN;
  313. }
  314. }
  315. ///////////////////////////////////////////////////////////////////////////////
  316. u32 ScanUTF8Char ( ccp * p_str )
  317. {
  318. // scan a UTF8 char. Set bit LONG_MAX if an error seen.
  319. // *str is set to next next char if on no error.
  320. int n_cont;
  321. ccp ptr = *p_str;
  322. u32 result = (uchar)*ptr++;
  323. switch (CheckUTF8Mode(result))
  324. {
  325. case DC_UTF8_1CHAR:
  326. if (result)
  327. (*p_str)++;
  328. return result;
  329. case DC_UTF8_2CHAR:
  330. result &= 0x1f;
  331. n_cont = 1;
  332. break;
  333. case DC_UTF8_3CHAR:
  334. result &= 0x0f;
  335. n_cont = 2;
  336. break;
  337. case DC_UTF8_4CHAR:
  338. result &= 0x07;
  339. n_cont = 3;
  340. break;
  341. case DC_UTF8_CONT_ANY:
  342. if ( CheckUTF8Mode((uchar)*ptr) && CheckUTF8Mode((uchar)*++ptr) )
  343. ptr++;
  344. *p_str = ptr;
  345. return S32_MIN;
  346. default: // DC_UTF8_ILLEGAL
  347. (*p_str)++;
  348. return result & 0x7f | S32_MIN;
  349. }
  350. while ( n_cont-- > 0 )
  351. {
  352. if ( CheckUTF8Mode(*ptr) == DC_UTF8_CONT_ANY )
  353. result = result << 6 | *ptr++ & 0x3f;
  354. else
  355. {
  356. result |= S32_MIN;
  357. break;
  358. }
  359. }
  360. *p_str = ptr;
  361. return result;
  362. }
  363. //-----------------------------------------------------------------------------
  364. u32 ScanUTF8CharE ( ccp * p_str, ccp end )
  365. {
  366. // scan a UTF8 char. Set bit S32_MIN if an error seen
  367. // *str is set to next next char if on no error.
  368. ccp ptr = *p_str;
  369. if ( ptr >= end )
  370. return S32_MIN;
  371. int n_cont;
  372. u32 result = (uchar)*ptr++;
  373. switch (CheckUTF8Mode(result))
  374. {
  375. case DC_UTF8_1CHAR:
  376. (*p_str)++;
  377. return result;
  378. case DC_UTF8_2CHAR:
  379. if ( ptr >= end )
  380. return S32_MIN;
  381. result &= 0x1f;
  382. n_cont = 1;
  383. break;
  384. case DC_UTF8_3CHAR:
  385. if ( ptr+1 >= end )
  386. return S32_MIN;
  387. result &= 0x0f;
  388. n_cont = 2;
  389. break;
  390. case DC_UTF8_4CHAR:
  391. if ( ptr+2 >= end )
  392. return S32_MIN;
  393. result &= 0x07;
  394. n_cont = 3;
  395. break;
  396. case DC_UTF8_CONT_ANY:
  397. if ( ptr < end && CheckUTF8Mode((uchar)*ptr)
  398. && ++ptr < end && CheckUTF8Mode((uchar)*ptr) )
  399. ptr++;
  400. *p_str = ptr;
  401. return S32_MIN;
  402. default: // DC_UTF8_ILLEGAL
  403. (*p_str)++;
  404. return result & 0x7f | S32_MIN;
  405. }
  406. while ( n_cont-- > 0 )
  407. {
  408. if ( CheckUTF8Mode(*ptr) == DC_UTF8_CONT_ANY )
  409. result = result << 6 | *ptr++ & 0x3f;
  410. else
  411. {
  412. result |= S32_MIN;
  413. break;
  414. }
  415. }
  416. *p_str = ptr;
  417. return result;
  418. }
  419. ///////////////////////////////////////////////////////////////////////////////
  420. u32 ScanUTF8CharInc ( ccp * p_str )
  421. {
  422. // scan a UTF8 char. Set bit LONG_MAX if an error seen
  423. // *str is set to next next char => it is incremetned always!
  424. int n_cont;
  425. ccp ptr = *p_str;
  426. u32 result = (uchar)*ptr++;
  427. switch (CheckUTF8Mode(result))
  428. {
  429. case DC_UTF8_1CHAR:
  430. (*p_str)++;
  431. return result;
  432. case DC_UTF8_2CHAR:
  433. result &= 0x1f;
  434. n_cont = 1;
  435. break;
  436. case DC_UTF8_3CHAR:
  437. result &= 0x0f;
  438. n_cont = 2;
  439. break;
  440. case DC_UTF8_4CHAR:
  441. result &= 0x07;
  442. n_cont = 3;
  443. break;
  444. case DC_UTF8_CONT_ANY:
  445. if ( CheckUTF8Mode((uchar)*ptr) && CheckUTF8Mode((uchar)*++ptr) )
  446. ptr++;
  447. *p_str = ptr;
  448. return S32_MIN;
  449. default: // DC_UTF8_ILLEGAL
  450. (*p_str)++;
  451. return result & 0x7f | S32_MIN;
  452. }
  453. while ( n_cont-- > 0 )
  454. {
  455. if ( CheckUTF8Mode(*ptr) == DC_UTF8_CONT_ANY )
  456. result = result << 6 | *ptr++ & 0x3f;
  457. else
  458. {
  459. result |= S32_MIN;
  460. break;
  461. }
  462. }
  463. *p_str = ptr;
  464. return result;
  465. }
  466. //-----------------------------------------------------------------------------
  467. u32 ScanUTF8CharIncE ( ccp * p_str, ccp end )
  468. {
  469. // scan a UTF8 char. Set bit LONG_MAX if an error seen
  470. // *str is set to next next char => it is incremetned always!
  471. ccp ptr = *p_str;
  472. if ( ptr >= end )
  473. {
  474. (*p_str)++;
  475. return S32_MIN;
  476. }
  477. int n_cont = 0;
  478. u32 result = (uchar)*ptr++;
  479. switch (CheckUTF8Mode(result))
  480. {
  481. case DC_UTF8_1CHAR:
  482. (*p_str)++;
  483. return result;
  484. case DC_UTF8_2CHAR:
  485. result &= 0x1f;
  486. n_cont = 1;
  487. break;
  488. case DC_UTF8_3CHAR:
  489. result &= 0x0f;
  490. n_cont = 2;
  491. break;
  492. case DC_UTF8_4CHAR:
  493. result &= 0x07;
  494. n_cont = 3;
  495. break;
  496. case DC_UTF8_CONT_ANY:
  497. if ( ptr < end && CheckUTF8Mode((uchar)*ptr)
  498. && ++ptr < end && CheckUTF8Mode((uchar)*ptr) )
  499. ptr++;
  500. *p_str = ptr;
  501. return S32_MIN;
  502. default: // DC_UTF8_ILLEGAL
  503. (*p_str)++;
  504. return result & 0x7f | S32_MIN;
  505. }
  506. while ( n_cont-- > 0 )
  507. {
  508. if ( ptr < end && CheckUTF8Mode(*ptr) == DC_UTF8_CONT_ANY )
  509. result = result << 6 | *ptr++ & 0x3f;
  510. else
  511. {
  512. result |= S32_MIN;
  513. break;
  514. }
  515. }
  516. *p_str = ptr;
  517. return result;
  518. }
  519. // ////////////////////////////////////////////////////////////////////////////
  520. ///////////////////////////////////////////////////////////////////////////////
  521. u32 GetUTF8AnsiChar ( ccp str )
  522. {
  523. // scan an UTF8 char. On error scan an ANSI char!
  524. const uchar * ptr = (const uchar *)str;
  525. u32 result = *ptr++;
  526. switch (CheckUTF8Mode(result))
  527. {
  528. case DC_UTF8_2CHAR:
  529. if ( CheckUTF8Mode(*ptr) == DC_UTF8_CONT_ANY )
  530. {
  531. return ( result & 0x1f ) << 6 | *ptr & 0x3f;
  532. }
  533. return result;
  534. case DC_UTF8_3CHAR:
  535. if ( CheckUTF8Mode(ptr[0]) == DC_UTF8_CONT_ANY
  536. && CheckUTF8Mode(ptr[1]) == DC_UTF8_CONT_ANY )
  537. {
  538. return (( result & 0x0f ) << 6
  539. | ptr[0] & 0x3f ) << 6
  540. | ptr[1] & 0x3f;
  541. }
  542. return result;
  543. case DC_UTF8_4CHAR:
  544. if ( CheckUTF8Mode(ptr[0]) == DC_UTF8_CONT_ANY
  545. && CheckUTF8Mode(ptr[1]) == DC_UTF8_CONT_ANY
  546. && CheckUTF8Mode(ptr[2]) == DC_UTF8_CONT_ANY )
  547. {
  548. return ((( result & 0x07 ) << 6
  549. | ptr[0] & 0x3f ) << 6
  550. | ptr[1] & 0x3f ) << 6
  551. | ptr[2] & 0x3f;
  552. }
  553. return result;
  554. default:
  555. return result;
  556. }
  557. }
  558. ///////////////////////////////////////////////////////////////////////////////
  559. u32 ScanUTF8AnsiChar ( ccp * p_str )
  560. {
  561. // scan an UTF8 char. On error scan an ANSI char!
  562. const uchar * ptr = (const uchar *)*p_str;
  563. u32 result = *ptr++;
  564. switch (CheckUTF8Mode(result))
  565. {
  566. case DC_UTF8_2CHAR:
  567. if ( CheckUTF8Mode(*ptr) == DC_UTF8_CONT_ANY )
  568. {
  569. result = ( result & 0x1f ) << 6 | *ptr++ & 0x3f;
  570. }
  571. break;
  572. case DC_UTF8_3CHAR:
  573. if ( CheckUTF8Mode(ptr[0]) == DC_UTF8_CONT_ANY
  574. && CheckUTF8Mode(ptr[1]) == DC_UTF8_CONT_ANY )
  575. {
  576. result = (( result & 0x0f ) << 6
  577. | ptr[0] & 0x3f ) << 6
  578. | ptr[1] & 0x3f;
  579. ptr += 2;
  580. }
  581. break;
  582. case DC_UTF8_4CHAR:
  583. if ( CheckUTF8Mode(ptr[0]) == DC_UTF8_CONT_ANY
  584. && CheckUTF8Mode(ptr[1]) == DC_UTF8_CONT_ANY
  585. && CheckUTF8Mode(ptr[2]) == DC_UTF8_CONT_ANY )
  586. {
  587. result = ((( result & 0x07 ) << 6
  588. | ptr[0] & 0x3f ) << 6
  589. | ptr[1] & 0x3f ) << 6
  590. | ptr[2] & 0x3f;
  591. ptr += 3;
  592. }
  593. break;
  594. default:
  595. break;
  596. }
  597. *p_str = (ccp)ptr;
  598. return result;
  599. }
  600. //-----------------------------------------------------------------------------
  601. u32 ScanUTF8AnsiCharE ( ccp * p_str, ccp end )
  602. {
  603. // scan an UTF8 char. On error scan an ANSI char!
  604. const uchar * ptr = (const uchar *)*p_str;
  605. if ( (ccp)ptr >= end )
  606. {
  607. (*p_str)++;
  608. return S32_MIN;
  609. }
  610. u32 result = *ptr++;
  611. switch (CheckUTF8Mode(result))
  612. {
  613. case DC_UTF8_2CHAR:
  614. if ( (ccp)ptr < end
  615. && CheckUTF8Mode(*ptr) == DC_UTF8_CONT_ANY )
  616. {
  617. result = ( result & 0x1f ) << 6 | *ptr++ & 0x3f;
  618. }
  619. break;
  620. case DC_UTF8_3CHAR:
  621. if ( (ccp)ptr+1 < end
  622. && CheckUTF8Mode(ptr[0]) == DC_UTF8_CONT_ANY
  623. && CheckUTF8Mode(ptr[1]) == DC_UTF8_CONT_ANY )
  624. {
  625. result = (( result & 0x0f ) << 6
  626. | ptr[0] & 0x3f ) << 6
  627. | ptr[1] & 0x3f;
  628. ptr += 2;
  629. }
  630. break;
  631. case DC_UTF8_4CHAR:
  632. if ( (ccp)ptr+2 < end
  633. && CheckUTF8Mode(ptr[0]) == DC_UTF8_CONT_ANY
  634. && CheckUTF8Mode(ptr[1]) == DC_UTF8_CONT_ANY
  635. && CheckUTF8Mode(ptr[2]) == DC_UTF8_CONT_ANY )
  636. {
  637. result = ((( result & 0x07 ) << 6
  638. | ptr[0] & 0x3f ) << 6
  639. | ptr[1] & 0x3f ) << 6
  640. | ptr[2] & 0x3f;
  641. ptr += 3;
  642. }
  643. break;
  644. default:
  645. break;
  646. }
  647. *p_str = (ccp)ptr;
  648. return result;
  649. }
  650. ///////////////////////////////////////////////////////////////////////////////
  651. ///////////////////////////////////////////////////////////////////////////////
  652. int ScanUTF8Length ( ccp str )
  653. {
  654. int count = 0;
  655. if (str)
  656. {
  657. ccp ptr = str;
  658. for(;;)
  659. {
  660. const char ch = *ptr++;
  661. if (!ch)
  662. break;
  663. switch (CheckUTF8Mode(ch))
  664. {
  665. case DC_UTF8_2CHAR:
  666. if ( CheckUTF8Mode(*ptr) == DC_UTF8_CONT_ANY )
  667. ptr++;
  668. break;
  669. case DC_UTF8_3CHAR:
  670. if ( CheckUTF8Mode(ptr[0]) == DC_UTF8_CONT_ANY
  671. && CheckUTF8Mode(ptr[1]) == DC_UTF8_CONT_ANY )
  672. ptr += 2;
  673. break;
  674. case DC_UTF8_4CHAR:
  675. if ( CheckUTF8Mode(ptr[0]) == DC_UTF8_CONT_ANY
  676. && CheckUTF8Mode(ptr[1]) == DC_UTF8_CONT_ANY
  677. && CheckUTF8Mode(ptr[2]) == DC_UTF8_CONT_ANY )
  678. ptr += 3;
  679. break;
  680. default:
  681. break;
  682. }
  683. count++;
  684. }
  685. }
  686. return count;
  687. }
  688. //-----------------------------------------------------------------------------
  689. int ScanUTF8LengthE ( ccp str, ccp end )
  690. {
  691. if (!end)
  692. return ScanUTF8Length(str);
  693. int count = 0;
  694. if (str)
  695. {
  696. ccp ptr = str;
  697. while ( ptr < end )
  698. {
  699. const char ch = *ptr++;
  700. switch (CheckUTF8Mode(ch))
  701. {
  702. case DC_UTF8_2CHAR:
  703. if ( CheckUTF8Mode(*ptr) == DC_UTF8_CONT_ANY )
  704. ptr++;
  705. break;
  706. case DC_UTF8_3CHAR:
  707. if ( CheckUTF8Mode(ptr[0]) == DC_UTF8_CONT_ANY
  708. && CheckUTF8Mode(ptr[1]) == DC_UTF8_CONT_ANY )
  709. ptr += 2;
  710. break;
  711. case DC_UTF8_4CHAR:
  712. if ( CheckUTF8Mode(ptr[0]) == DC_UTF8_CONT_ANY
  713. && CheckUTF8Mode(ptr[1]) == DC_UTF8_CONT_ANY
  714. && CheckUTF8Mode(ptr[2]) == DC_UTF8_CONT_ANY )
  715. ptr += 3;
  716. break;
  717. default:
  718. break;
  719. }
  720. count++;
  721. }
  722. }
  723. return count;
  724. }
  725. //-----------------------------------------------------------------------------
  726. int ScanEUTF8Length ( ccp str )
  727. {
  728. int count = 0;
  729. if (str)
  730. {
  731. ccp ptr = str;
  732. for(;;)
  733. {
  734. const char ch = *ptr++;
  735. if (!ch)
  736. break;
  737. if ( ch == '\e' )
  738. {
  739. ptr = SkipEscapes(ptr-1);
  740. continue;
  741. }
  742. switch (CheckUTF8Mode(ch))
  743. {
  744. case DC_UTF8_2CHAR:
  745. if ( CheckUTF8Mode(*ptr) == DC_UTF8_CONT_ANY )
  746. ptr++;
  747. break;
  748. case DC_UTF8_3CHAR:
  749. if ( CheckUTF8Mode(ptr[0]) == DC_UTF8_CONT_ANY
  750. && CheckUTF8Mode(ptr[1]) == DC_UTF8_CONT_ANY )
  751. ptr += 2;
  752. break;
  753. case DC_UTF8_4CHAR:
  754. if ( CheckUTF8Mode(ptr[0]) == DC_UTF8_CONT_ANY
  755. && CheckUTF8Mode(ptr[1]) == DC_UTF8_CONT_ANY
  756. && CheckUTF8Mode(ptr[2]) == DC_UTF8_CONT_ANY )
  757. ptr += 3;
  758. break;
  759. default:
  760. break;
  761. }
  762. count++;
  763. }
  764. }
  765. return count;
  766. }
  767. //-----------------------------------------------------------------------------
  768. int ScanEUTF8LengthE ( ccp str, ccp end )
  769. {
  770. if (!end)
  771. return ScanEUTF8Length(str);
  772. int count = 0;
  773. if (str)
  774. {
  775. ccp ptr = str;
  776. while ( ptr < end )
  777. {
  778. const char ch = *ptr++;
  779. if ( ch == '\e' )
  780. {
  781. ptr = SkipEscapesE(ptr-1,end);
  782. continue;
  783. }
  784. switch (CheckUTF8Mode(ch))
  785. {
  786. case DC_UTF8_2CHAR:
  787. if ( CheckUTF8Mode(*ptr) == DC_UTF8_CONT_ANY )
  788. ptr++;
  789. break;
  790. case DC_UTF8_3CHAR:
  791. if ( CheckUTF8Mode(ptr[0]) == DC_UTF8_CONT_ANY
  792. && CheckUTF8Mode(ptr[1]) == DC_UTF8_CONT_ANY )
  793. ptr += 2;
  794. break;
  795. case DC_UTF8_4CHAR:
  796. if ( CheckUTF8Mode(ptr[0]) == DC_UTF8_CONT_ANY
  797. && CheckUTF8Mode(ptr[1]) == DC_UTF8_CONT_ANY
  798. && CheckUTF8Mode(ptr[2]) == DC_UTF8_CONT_ANY )
  799. ptr += 3;
  800. break;
  801. default:
  802. break;
  803. }
  804. count++;
  805. }
  806. }
  807. return count;
  808. }
  809. ///////////////////////////////////////////////////////////////////////////////
  810. ///////////////////////////////////////////////////////////////////////////////
  811. int CalcUTF8PrintFW ( ccp str, ccp end, uint wanted_fw )
  812. {
  813. const uint bytecount = end ? end - str : strlen(str);
  814. const uint utf8len = ScanUTF8LengthE(str,end);
  815. return utf8len < wanted_fw
  816. ? wanted_fw - utf8len + bytecount
  817. : bytecount;
  818. }
  819. ///////////////////////////////////////////////////////////////////////////////
  820. ///////////////////////////////////////////////////////////////////////////////
  821. char * PrintUTF8Char ( char * buf, u32 code )
  822. {
  823. code &= DCLIB_UNICODE_CODE_MASK;
  824. if ( code <= DCLIB_UNICODE_MAX_UTF8_1 )
  825. {
  826. *buf++ = code;
  827. }
  828. else if ( code <= DCLIB_UNICODE_MAX_UTF8_2 )
  829. {
  830. *buf++ = code >> 6 | 0xc0;
  831. *buf++ = code & 0x3f | 0x80;
  832. }
  833. else if ( code <= DCLIB_UNICODE_MAX_UTF8_3 )
  834. {
  835. *buf++ = code >> 12 | 0xe0;
  836. *buf++ = code >> 6 & 0x3f | 0x80;
  837. *buf++ = code & 0x3f | 0x80;
  838. }
  839. else
  840. {
  841. *buf++ = code >> 18 & 0x07 | 0xf0;
  842. *buf++ = code >> 12 & 0x3f | 0x80;
  843. *buf++ = code >> 6 & 0x3f | 0x80;
  844. *buf++ = code & 0x3f | 0x80;
  845. }
  846. return buf;
  847. }
  848. ///////////////////////////////////////////////////////////////////////////////
  849. char * PrintUTF8CharToCircBuf ( u32 code )
  850. {
  851. char *buf;
  852. code &= DCLIB_UNICODE_CODE_MASK;
  853. if ( code <= DCLIB_UNICODE_MAX_UTF8_1 )
  854. {
  855. buf = GetCircBuf(2);
  856. buf[0] = code;
  857. buf[1] = 0;
  858. }
  859. else if ( code <= DCLIB_UNICODE_MAX_UTF8_2 )
  860. {
  861. buf = GetCircBuf(3);
  862. buf[0] = code >> 6 | 0xc0;
  863. buf[1] = code & 0x3f | 0x80;
  864. buf[2] = 0;
  865. }
  866. else if ( code <= DCLIB_UNICODE_MAX_UTF8_3 )
  867. {
  868. buf = GetCircBuf(4);
  869. buf[0] = code >> 12 | 0xe0;
  870. buf[1] = code >> 6 & 0x3f | 0x80;
  871. buf[2] = code & 0x3f | 0x80;
  872. buf[3] = 0;
  873. }
  874. else
  875. {
  876. buf = GetCircBuf(5);
  877. buf[0] = code >> 18 & 0x07 | 0xf0;
  878. buf[1] = code >> 12 & 0x3f | 0x80;
  879. buf[2] = code >> 6 & 0x3f | 0x80;
  880. buf[3] = code & 0x3f | 0x80;
  881. buf[4] = 0;
  882. }
  883. return buf;
  884. }
  885. ///////////////////////////////////////////////////////////////////////////////
  886. ///////////////////////////////////////////////////////////////////////////////
  887. exmem_t AlignUTF8 ( exmem_dest_t *dest, ccp str, int str_len, int fw, int prec )
  888. {
  889. int slen = str_len < 0
  890. ? ScanUTF8Length(str)
  891. : ScanUTF8LengthE(str,str+str_len);
  892. if ( prec >= 0 && slen > prec )
  893. slen = prec;
  894. const int align_left = fw < 0;
  895. if (align_left)
  896. fw = -fw;
  897. if ( fw < slen )
  898. fw = slen;
  899. int spaces = fw - slen;
  900. ccp end = SkipUTF8Char(str,slen);
  901. const int copy_len = end - str;
  902. exmem_t res = GetExmemDestBuf(dest,copy_len+spaces);
  903. char *buf = (char*)res.data.ptr;
  904. DASSERT(buf);
  905. if (align_left)
  906. {
  907. memcpy(buf,str,copy_len);
  908. memset(buf+copy_len,' ',spaces);
  909. }
  910. else
  911. {
  912. memset(buf,' ',spaces);
  913. memcpy(buf+spaces,str,copy_len);
  914. }
  915. return res;
  916. }
  917. ///////////////////////////////////////////////////////////////////////////////
  918. ccp AlignUTF8ToCircBuf ( ccp str, int fw, int prec )
  919. {
  920. uint len = ScanUTF8Length(str);
  921. if ( prec >= 0 && len > prec )
  922. len = prec;
  923. const int align_left = fw < 0;
  924. if ( align_left)
  925. fw = -fw;
  926. if ( fw < len )
  927. fw = len;
  928. int spaces = fw - len;
  929. ccp end = SkipUTF8Char(str,len);
  930. const int copy_len = end - str;
  931. char *buf = GetCircBuf(copy_len+spaces+1);
  932. DASSERT(buf);
  933. if (align_left)
  934. {
  935. memcpy(buf,str,copy_len);
  936. memset(buf+copy_len,' ',spaces);
  937. }
  938. else
  939. {
  940. memset(buf,' ',spaces);
  941. memcpy(buf+spaces,str,copy_len);
  942. }
  943. buf[copy_len+spaces] = 0;
  944. return buf;
  945. }
  946. ///////////////////////////////////////////////////////////////////////////////
  947. ///////////////////////////////////////////////////////////////////////////////
  948. exmem_t AlignEUTF8 ( exmem_dest_t *dest, ccp str, int str_len, int fw, int prec )
  949. {
  950. int slen = str_len < 0
  951. ? ScanUTF8Length(str)
  952. : ScanUTF8LengthE(str,str+str_len);
  953. if ( prec >= 0 && slen > prec )
  954. slen = prec;
  955. const int align_left = fw < 0;
  956. if (align_left)
  957. fw = -fw;
  958. if ( fw < slen )
  959. fw = slen;
  960. int spaces = fw - slen;
  961. ccp end = SkipEUTF8Char(str,slen);
  962. const int copy_len = end - str;
  963. exmem_t res = GetExmemDestBuf(dest,copy_len+spaces);
  964. char *buf = (char*)res.data.ptr;
  965. DASSERT(buf);
  966. if (align_left)
  967. {
  968. memcpy(buf,str,copy_len);
  969. memset(buf+copy_len,' ',spaces);
  970. }
  971. else
  972. {
  973. memset(buf,' ',spaces);
  974. memcpy(buf+spaces,str,copy_len);
  975. }
  976. return res;
  977. }
  978. ///////////////////////////////////////////////////////////////////////////////
  979. ccp AlignEUTF8ToCircBuf ( ccp str, int fw, int prec )
  980. {
  981. uint len = ScanEUTF8Length(str);
  982. if ( prec >= 0 && len > prec )
  983. len = prec;
  984. const int align_left = fw < 0;
  985. if ( align_left)
  986. fw = -fw;
  987. if ( fw < len )
  988. fw = len;
  989. int spaces = fw - len;
  990. ccp end = SkipEUTF8Char(str,len);
  991. const int copy_len = end - str;
  992. char *buf = GetCircBuf(copy_len+spaces+1);
  993. DASSERT(buf);
  994. if (align_left)
  995. {
  996. memcpy(buf,str,copy_len);
  997. memset(buf+copy_len,' ',spaces);
  998. }
  999. else
  1000. {
  1001. memset(buf,' ',spaces);
  1002. memcpy(buf+spaces,str,copy_len);
  1003. }
  1004. buf[copy_len+spaces] = 0;
  1005. return buf;
  1006. }
  1007. //
  1008. ///////////////////////////////////////////////////////////////////////////////
  1009. ///////////////////////////////////////////////////////////////////////////////
  1010. // this table is directly generated from
  1011. // http://unicode.org/Public/UNIDATA/UnicodeData.txt
  1012. const dcUnicodeTripel TableUnicodeDecomp[] =
  1013. {
  1014. { 0x0000c0, 0x000041,0x000300 },
  1015. { 0x0000c1, 0x000041,0x000301 },
  1016. { 0x0000c2, 0x000041,0x000302 },
  1017. { 0x0000c3, 0x000041,0x000303 },
  1018. { 0x0000c4, 0x000041,0x000308 },
  1019. { 0x0000c5, 0x000041,0x00030a },
  1020. { 0x0000c7, 0x000043,0x000327 },
  1021. { 0x0000c8, 0x000045,0x000300 },
  1022. { 0x0000c9, 0x000045,0x000301 },
  1023. { 0x0000ca, 0x000045,0x000302 },
  1024. { 0x0000cb, 0x000045,0x000308 },
  1025. { 0x0000cc, 0x000049,0x000300 },
  1026. { 0x0000cd, 0x000049,0x000301 },
  1027. { 0x0000ce, 0x000049,0x000302 },
  1028. { 0x0000cf, 0x000049,0x000308 },
  1029. { 0x0000d1, 0x00004e,0x000303 },
  1030. { 0x0000d2, 0x00004f,0x000300 },
  1031. { 0x0000d3, 0x00004f,0x000301 },
  1032. { 0x0000d4, 0x00004f,0x000302 },
  1033. { 0x0000d5, 0x00004f,0x000303 },
  1034. { 0x0000d6, 0x00004f,0x000308 },
  1035. { 0x0000d9, 0x000055,0x000300 },
  1036. { 0x0000da, 0x000055,0x000301 },
  1037. { 0x0000db, 0x000055,0x000302 },
  1038. { 0x0000dc, 0x000055,0x000308 },
  1039. { 0x0000dd, 0x000059,0x000301 },
  1040. { 0x0000e0, 0x000061,0x000300 },
  1041. { 0x0000e1, 0x000061,0x000301 },
  1042. { 0x0000e2, 0x000061,0x000302 },
  1043. { 0x0000e3, 0x000061,0x000303 },
  1044. { 0x0000e4, 0x000061,0x000308 },
  1045. { 0x0000e5, 0x000061,0x00030a },
  1046. { 0x0000e7, 0x000063,0x000327 },
  1047. { 0x0000e8, 0x000065,0x000300 },
  1048. { 0x0000e9, 0x000065,0x000301 },
  1049. { 0x0000ea, 0x000065,0x000302 },
  1050. { 0x0000eb, 0x000065,0x000308 },
  1051. { 0x0000ec, 0x000069,0x000300 },
  1052. { 0x0000ed, 0x000069,0x000301 },
  1053. { 0x0000ee, 0x000069,0x000302 },
  1054. { 0x0000ef, 0x000069,0x000308 },
  1055. { 0x0000f1, 0x00006e,0x000303 },
  1056. { 0x0000f2, 0x00006f,0x000300 },
  1057. { 0x0000f3, 0x00006f,0x000301 },
  1058. { 0x0000f4, 0x00006f,0x000302 },
  1059. { 0x0000f5, 0x00006f,0x000303 },
  1060. { 0x0000f6, 0x00006f,0x000308 },
  1061. { 0x0000f9, 0x000075,0x000300 },
  1062. { 0x0000fa, 0x000075,0x000301 },
  1063. { 0x0000fb, 0x000075,0x000302 },
  1064. { 0x0000fc, 0x000075,0x000308 },
  1065. { 0x0000fd, 0x000079,0x000301 },
  1066. { 0x0000ff, 0x000079,0x000308 },
  1067. { 0x000100, 0x000041,0x000304 },
  1068. { 0x000101, 0x000061,0x000304 },
  1069. { 0x000102, 0x000041,0x000306 },
  1070. { 0x000103, 0x000061,0x000306 },
  1071. { 0x000104, 0x000041,0x000328 },
  1072. { 0x000105, 0x000061,0x000328 },
  1073. { 0x000106, 0x000043,0x000301 },
  1074. { 0x000107, 0x000063,0x000301 },
  1075. { 0x000108, 0x000043,0x000302 },
  1076. { 0x000109, 0x000063,0x000302 },
  1077. { 0x00010a, 0x000043,0x000307 },
  1078. { 0x00010b, 0x000063,0x000307 },
  1079. { 0x00010c, 0x000043,0x00030c },
  1080. { 0x00010d, 0x000063,0x00030c },
  1081. { 0x00010e, 0x000044,0x00030c },
  1082. { 0x00010f, 0x000064,0x00030c },
  1083. { 0x000112, 0x000045,0x000304 },
  1084. { 0x000113, 0x000065,0x000304 },
  1085. { 0x000114, 0x000045,0x000306 },
  1086. { 0x000115, 0x000065,0x000306 },
  1087. { 0x000116, 0x000045,0x000307 },
  1088. { 0x000117, 0x000065,0x000307 },
  1089. { 0x000118, 0x000045,0x000328 },
  1090. { 0x000119, 0x000065,0x000328 },
  1091. { 0x00011a, 0x000045,0x00030c },
  1092. { 0x00011b, 0x000065,0x00030c },
  1093. { 0x00011c, 0x000047,0x000302 },
  1094. { 0x00011d, 0x000067,0x000302 },
  1095. { 0x00011e, 0x000047,0x000306 },
  1096. { 0x00011f, 0x000067,0x000306 },
  1097. { 0x000120, 0x000047,0x000307 },
  1098. { 0x000121, 0x000067,0x000307 },
  1099. { 0x000122, 0x000047,0x000327 },
  1100. { 0x000123, 0x000067,0x000327 },
  1101. { 0x000124, 0x000048,0x000302 },
  1102. { 0x000125, 0x000068,0x000302 },
  1103. { 0x000128, 0x000049,0x000303 },
  1104. { 0x000129, 0x000069,0x000303 },
  1105. { 0x00012a, 0x000049,0x000304 },
  1106. { 0x00012b, 0x000069,0x000304 },
  1107. { 0x00012c, 0x000049,0x000306 },
  1108. { 0x00012d, 0x000069,0x000306 },
  1109. { 0x00012e, 0x000049,0x000328 },
  1110. { 0x00012f, 0x000069,0x000328 },
  1111. { 0x000130, 0x000049,0x000307 },
  1112. { 0x000134, 0x00004a,0x000302 },
  1113. { 0x000135, 0x00006a,0x000302 },
  1114. { 0x000136, 0x00004b,0x000327 },
  1115. { 0x000137, 0x00006b,0x000327 },
  1116. { 0x000139, 0x00004c,0x000301 },
  1117. { 0x00013a, 0x00006c,0x000301 },
  1118. { 0x00013b, 0x00004c,0x000327 },
  1119. { 0x00013c, 0x00006c,0x000327 },
  1120. { 0x00013d, 0x00004c,0x00030c },
  1121. { 0x00013e, 0x00006c,0x00030c },
  1122. { 0x000143, 0x00004e,0x000301 },
  1123. { 0x000144, 0x00006e,0x000301 },
  1124. { 0x000145, 0x00004e,0x000327 },
  1125. { 0x000146, 0x00006e,0x000327 },
  1126. { 0x000147, 0x00004e,0x00030c },
  1127. { 0x000148, 0x00006e,0x00030c },
  1128. { 0x00014c, 0x00004f,0x000304 },
  1129. { 0x00014d, 0x00006f,0x000304 },
  1130. { 0x00014e, 0x00004f,0x000306 },
  1131. { 0x00014f, 0x00006f,0x000306 },
  1132. { 0x000150, 0x00004f,0x00030b },
  1133. { 0x000151, 0x00006f,0x00030b },
  1134. { 0x000154, 0x000052,0x000301 },
  1135. { 0x000155, 0x000072,0x000301 },
  1136. { 0x000156, 0x000052,0x000327 },
  1137. { 0x000157, 0x000072,0x000327 },
  1138. { 0x000158, 0x000052,0x00030c },
  1139. { 0x000159, 0x000072,0x00030c },
  1140. { 0x00015a, 0x000053,0x000301 },
  1141. { 0x00015b, 0x000073,0x000301 },
  1142. { 0x00015c, 0x000053,0x000302 },
  1143. { 0x00015d, 0x000073,0x000302 },
  1144. { 0x00015e, 0x000053,0x000327 },
  1145. { 0x00015f, 0x000073,0x000327 },
  1146. { 0x000160, 0x000053,0x00030c },
  1147. { 0x000161, 0x000073,0x00030c },
  1148. { 0x000162, 0x000054,0x000327 },
  1149. { 0x000163, 0x000074,0x000327 },
  1150. { 0x000164, 0x000054,0x00030c },
  1151. { 0x000165, 0x000074,0x00030c },
  1152. { 0x000168, 0x000055,0x000303 },
  1153. { 0x000169, 0x000075,0x000303 },
  1154. { 0x00016a, 0x000055,0x000304 },
  1155. { 0x00016b, 0x000075,0x000304 },
  1156. { 0x00016c, 0x000055,0x000306 },
  1157. { 0x00016d, 0x000075,0x000306 },
  1158. { 0x00016e, 0x000055,0x00030a },
  1159. { 0x00016f, 0x000075,0x00030a },
  1160. { 0x000170, 0x000055,0x00030b },
  1161. { 0x000171, 0x000075,0x00030b },
  1162. { 0x000172, 0x000055,0x000328 },
  1163. { 0x000173, 0x000075,0x000328 },
  1164. { 0x000174, 0x000057,0x000302 },
  1165. { 0x000175, 0x000077,0x000302 },
  1166. { 0x000176, 0x000059,0x000302 },
  1167. { 0x000177, 0x000079,0x000302 },
  1168. { 0x000178, 0x000059,0x000308 },
  1169. { 0x000179, 0x00005a,0x000301 },
  1170. { 0x00017a, 0x00007a,0x000301 },
  1171. { 0x00017b, 0x00005a,0x000307 },
  1172. { 0x00017c, 0x00007a,0x000307 },
  1173. { 0x00017d, 0x00005a,0x00030c },
  1174. { 0x00017e, 0x00007a,0x00030c },
  1175. { 0x0001a0, 0x00004f,0x00031b },
  1176. { 0x0001a1, 0x00006f,0x00031b },
  1177. { 0x0001af, 0x000055,0x00031b },
  1178. { 0x0001b0, 0x000075,0x00031b },
  1179. { 0x0001cd, 0x000041,0x00030c },
  1180. { 0x0001ce, 0x000061,0x00030c },
  1181. { 0x0001cf, 0x000049,0x00030c },
  1182. { 0x0001d0, 0x000069,0x00030c },
  1183. { 0x0001d1, 0x00004f,0x00030c },
  1184. { 0x0001d2, 0x00006f,0x00030c },
  1185. { 0x0001d3, 0x000055,0x00030c },
  1186. { 0x0001d4, 0x000075,0x00030c },
  1187. { 0x0001d5, 0x0000dc,0x000304 },
  1188. { 0x0001d6, 0x0000fc,0x000304 },
  1189. { 0x0001d7, 0x0000dc,0x000301 },
  1190. { 0x0001d8, 0x0000fc,0x000301 },
  1191. { 0x0001d9, 0x0000dc,0x00030c },
  1192. { 0x0001da, 0x0000fc,0x00030c },
  1193. { 0x0001db, 0x0000dc,0x000300 },
  1194. { 0x0001dc, 0x0000fc,0x000300 },
  1195. { 0x0001de, 0x0000c4,0x000304 },
  1196. { 0x0001df, 0x0000e4,0x000304 },
  1197. { 0x0001e0, 0x000226,0x000304 },
  1198. { 0x0001e1, 0x000227,0x000304 },
  1199. { 0x0001e2, 0x0000c6,0x000304 },
  1200. { 0x0001e3, 0x0000e6,0x000304 },
  1201. { 0x0001e6, 0x000047,0x00030c },
  1202. { 0x0001e7, 0x000067,0x00030c },
  1203. { 0x0001e8, 0x00004b,0x00030c },
  1204. { 0x0001e9, 0x00006b,0x00030c },
  1205. { 0x0001ea, 0x00004f,0x000328 },
  1206. { 0x0001eb, 0x00006f,0x000328 },
  1207. { 0x0001ec, 0x0001ea,0x000304 },
  1208. { 0x0001ed, 0x0001eb,0x000304 },
  1209. { 0x0001ee, 0x0001b7,0x00030c },
  1210. { 0x0001ef, 0x000292,0x00030c },
  1211. { 0x0001f0, 0x00006a,0x00030c },
  1212. { 0x0001f4, 0x000047,0x000301 },
  1213. { 0x0001f5, 0x000067,0x000301 },
  1214. { 0x0001f8, 0x00004e,0x000300 },
  1215. { 0x0001f9, 0x00006e,0x000300 },
  1216. { 0x0001fa, 0x0000c5,0x000301 },
  1217. { 0x0001fb, 0x0000e5,0x000301 },
  1218. { 0x0001fc, 0x0000c6,0x000301 },
  1219. { 0x0001fd, 0x0000e6,0x000301 },
  1220. { 0x0001fe, 0x0000d8,0x000301 },
  1221. { 0x0001ff, 0x0000f8,0x000301 },
  1222. { 0x000200, 0x000041,0x00030f },
  1223. { 0x000201, 0x000061,0x00030f },
  1224. { 0x000202, 0x000041,0x000311 },
  1225. { 0x000203, 0x000061,0x000311 },
  1226. { 0x000204, 0x000045,0x00030f },
  1227. { 0x000205, 0x000065,0x00030f },
  1228. { 0x000206, 0x000045,0x000311 },
  1229. { 0x000207, 0x000065,0x000311 },
  1230. { 0x000208, 0x000049,0x00030f },
  1231. { 0x000209, 0x000069,0x00030f },
  1232. { 0x00020a, 0x000049,0x000311 },
  1233. { 0x00020b, 0x000069,0x000311 },
  1234. { 0x00020c, 0x00004f,0x00030f },
  1235. { 0x00020d, 0x00006f,0x00030f },
  1236. { 0x00020e, 0x00004f,0x000311 },
  1237. { 0x00020f, 0x00006f,0x000311 },
  1238. { 0x000210, 0x000052,0x00030f },
  1239. { 0x000211, 0x000072,0x00030f },
  1240. { 0x000212, 0x000052,0x000311 },
  1241. { 0x000213, 0x000072,0x000311 },
  1242. { 0x000214, 0x000055,0x00030f },
  1243. { 0x000215, 0x000075,0x00030f },
  1244. { 0x000216, 0x000055,0x000311 },
  1245. { 0x000217, 0x000075,0x000311 },
  1246. { 0x000218, 0x000053,0x000326 },
  1247. { 0x000219, 0x000073,0x000326 },
  1248. { 0x00021a, 0x000054,0x000326 },
  1249. { 0x00021b, 0x000074,0x000326 },
  1250. { 0x00021e, 0x000048,0x00030c },
  1251. { 0x00021f, 0x000068,0x00030c },
  1252. { 0x000226, 0x000041,0x000307 },
  1253. { 0x000227, 0x000061,0x000307 },
  1254. { 0x000228, 0x000045,0x000327 },
  1255. { 0x000229, 0x000065,0x000327 },
  1256. { 0x00022a, 0x0000d6,0x000304 },
  1257. { 0x00022b, 0x0000f6,0x000304 },
  1258. { 0x00022c, 0x0000d5,0x000304 },
  1259. { 0x00022d, 0x0000f5,0x000304 },
  1260. { 0x00022e, 0x00004f,0x000307 },
  1261. { 0x00022f, 0x00006f,0x000307 },
  1262. { 0x000230, 0x00022e,0x000304 },
  1263. { 0x000231, 0x00022f,0x000304 },
  1264. { 0x000232, 0x000059,0x000304 },
  1265. { 0x000233, 0x000079,0x000304 },
  1266. { 0x000344, 0x000308,0x000301 },
  1267. { 0x000385, 0x0000a8,0x000301 },
  1268. { 0x000386, 0x000391,0x000301 },
  1269. { 0x000388, 0x000395,0x000301 },
  1270. { 0x000389, 0x000397,0x000301 },
  1271. { 0x00038a, 0x000399,0x000301 },
  1272. { 0x00038c, 0x00039f,0x000301 },
  1273. { 0x00038e, 0x0003a5,0x000301 },
  1274. { 0x00038f, 0x0003a9,0x000301 },
  1275. { 0x000390, 0x0003ca,0x000301 },
  1276. { 0x0003aa, 0x000399,0x000308 },
  1277. { 0x0003ab, 0x0003a5,0x000308 },
  1278. { 0x0003ac, 0x0003b1,0x000301 },
  1279. { 0x0003ad, 0x0003b5,0x000301 },
  1280. { 0x0003ae, 0x0003b7,0x000301 },
  1281. { 0x0003af, 0x0003b9,0x000301 },
  1282. { 0x0003b0, 0x0003cb,0x000301 },
  1283. { 0x0003ca, 0x0003b9,0x000308 },
  1284. { 0x0003cb, 0x0003c5,0x000308 },
  1285. { 0x0003cc, 0x0003bf,0x000301 },
  1286. { 0x0003cd, 0x0003c5,0x000301 },
  1287. { 0x0003ce, 0x0003c9,0x000301 },
  1288. { 0x0003d3, 0x0003d2,0x000301 },
  1289. { 0x0003d4, 0x0003d2,0x000308 },
  1290. { 0x000400, 0x000415,0x000300 },
  1291. { 0x000401, 0x000415,0x000308 },
  1292. { 0x000403, 0x000413,0x000301 },
  1293. { 0x000407, 0x000406,0x000308 },
  1294. { 0x00040c, 0x00041a,0x000301 },
  1295. { 0x00040d, 0x000418,0x000300 },
  1296. { 0x00040e, 0x000423,0x000306 },
  1297. { 0x000419, 0x000418,0x000306 },
  1298. { 0x000439, 0x000438,0x000306 },
  1299. { 0x000450, 0x000435,0x000300 },
  1300. { 0x000451, 0x000435,0x000308 },
  1301. { 0x000453, 0x000433,0x000301 },
  1302. { 0x000457, 0x000456,0x000308 },
  1303. { 0x00045c, 0x00043a,0x000301 },
  1304. { 0x00045d, 0x000438,0x000300 },
  1305. { 0x00045e, 0x000443,0x000306 },
  1306. { 0x000476, 0x000474,0x00030f },
  1307. { 0x000477, 0x000475,0x00030f },
  1308. { 0x0004c1, 0x000416,0x000306 },
  1309. { 0x0004c2, 0x000436,0x000306 },
  1310. { 0x0004d0, 0x000410,0x000306 },
  1311. { 0x0004d1, 0x000430,0x000306 },
  1312. { 0x0004d2, 0x000410,0x000308 },
  1313. { 0x0004d3, 0x000430,0x000308 },
  1314. { 0x0004d6, 0x000415,0x000306 },
  1315. { 0x0004d7, 0x000435,0x000306 },
  1316. { 0x0004da, 0x0004d8,0x000308 },
  1317. { 0x0004db, 0x0004d9,0x000308 },
  1318. { 0x0004dc, 0x000416,0x000308 },
  1319. { 0x0004dd, 0x000436,0x000308 },
  1320. { 0x0004de, 0x000417,0x000308 },
  1321. { 0x0004df, 0x000437,0x000308 },
  1322. { 0x0004e2, 0x000418,0x000304 },
  1323. { 0x0004e3, 0x000438,0x000304 },
  1324. { 0x0004e4, 0x000418,0x000308 },
  1325. { 0x0004e5, 0x000438,0x000308 },
  1326. { 0x0004e6, 0x00041e,0x000308 },
  1327. { 0x0004e7, 0x00043e,0x000308 },
  1328. { 0x0004ea, 0x0004e8,0x000308 },
  1329. { 0x0004eb, 0x0004e9,0x000308 },
  1330. { 0x0004ec, 0x00042d,0x000308 },
  1331. { 0x0004ed, 0x00044d,0x000308 },
  1332. { 0x0004ee, 0x000423,0x000304 },
  1333. { 0x0004ef, 0x000443,0x000304 },
  1334. { 0x0004f0, 0x000423,0x000308 },
  1335. { 0x0004f1, 0x000443,0x000308 },
  1336. { 0x0004f2, 0x000423,0x00030b },
  1337. { 0x0004f3, 0x000443,0x00030b },
  1338. { 0x0004f4, 0x000427,0x000308 },
  1339. { 0x0004f5, 0x000447,0x000308 },
  1340. { 0x0004f8, 0x00042b,0x000308 },
  1341. { 0x0004f9, 0x00044b,0x000308 },
  1342. { 0x000622, 0x000627,0x000653 },
  1343. { 0x000623, 0x000627,0x000654 },
  1344. { 0x000624, 0x000648,0x000654 },
  1345. { 0x000625, 0x000627,0x000655 },
  1346. { 0x000626, 0x00064a,0x000654 },
  1347. { 0x0006c0, 0x0006d5,0x000654 },
  1348. { 0x0006c2, 0x0006c1,0x000654 },
  1349. { 0x0006d3, 0x0006d2,0x000654 },
  1350. { 0x000929, 0x000928,0x00093c },
  1351. { 0x000931, 0x000930,0x00093c },
  1352. { 0x000934, 0x000933,0x00093c },
  1353. { 0x000958, 0x000915,0x00093c },
  1354. { 0x000959, 0x000916,0x00093c },
  1355. { 0x00095a, 0x000917,0x00093c },
  1356. { 0x00095b, 0x00091c,0x00093c },
  1357. { 0x00095c, 0x000921,0x00093c },
  1358. { 0x00095d, 0x000922,0x00093c },
  1359. { 0x00095e, 0x00092b,0x00093c },
  1360. { 0x00095f, 0x00092f,0x00093c },
  1361. { 0x0009cb, 0x0009c7,0x0009be },
  1362. { 0x0009cc, 0x0009c7,0x0009d7 },
  1363. { 0x0009dc, 0x0009a1,0x0009bc },
  1364. { 0x0009dd, 0x0009a2,0x0009bc },
  1365. { 0x0009df, 0x0009af,0x0009bc },
  1366. { 0x000a33, 0x000a32,0x000a3c },
  1367. { 0x000a36, 0x000a38,0x000a3c },
  1368. { 0x000a59, 0x000a16,0x000a3c },
  1369. { 0x000a5a, 0x000a17,0x000a3c },
  1370. { 0x000a5b, 0x000a1c,0x000a3c },
  1371. { 0x000a5e, 0x000a2b,0x000a3c },
  1372. { 0x000b48, 0x000b47,0x000b56 },
  1373. { 0x000b4b, 0x000b47,0x000b3e },
  1374. { 0x000b4c, 0x000b47,0x000b57 },
  1375. { 0x000b5c, 0x000b21,0x000b3c },
  1376. { 0x000b5d, 0x000b22,0x000b3c },
  1377. { 0x000b94, 0x000b92,0x000bd7 },
  1378. { 0x000bca, 0x000bc6,0x000bbe },
  1379. { 0x000bcb, 0x000bc7,0x000bbe },
  1380. { 0x000bcc, 0x000bc6,0x000bd7 },
  1381. { 0x000c48, 0x000c46,0x000c56 },
  1382. { 0x000cc0, 0x000cbf,0x000cd5 },
  1383. { 0x000cc7, 0x000cc6,0x000cd5 },
  1384. { 0x000cc8, 0x000cc6,0x000cd6 },
  1385. { 0x000cca, 0x000cc6,0x000cc2 },
  1386. { 0x000ccb, 0x000cca,0x000cd5 },
  1387. { 0x000d4a, 0x000d46,0x000d3e },
  1388. { 0x000d4b, 0x000d47,0x000d3e },
  1389. { 0x000d4c, 0x000d46,0x000d57 },
  1390. { 0x000dda, 0x000dd9,0x000dca },
  1391. { 0x000ddc, 0x000dd9,0x000dcf },
  1392. { 0x000ddd, 0x000ddc,0x000dca },
  1393. { 0x000dde, 0x000dd9,0x000ddf },
  1394. { 0x000f43, 0x000f42,0x000fb7 },
  1395. { 0x000f4d, 0x000f4c,0x000fb7 },
  1396. { 0x000f52, 0x000f51,0x000fb7 },
  1397. { 0x000f57, 0x000f56,0x000fb7 },
  1398. { 0x000f5c, 0x000f5b,0x000fb7 },
  1399. { 0x000f69, 0x000f40,0x000fb5 },
  1400. { 0x000f73, 0x000f71,0x000f72 },
  1401. { 0x000f75, 0x000f71,0x000f74 },
  1402. { 0x000f76, 0x000fb2,0x000f80 },
  1403. { 0x000f78, 0x000fb3,0x000f80 },
  1404. { 0x000f81, 0x000f71,0x000f80 },
  1405. { 0x000f93, 0x000f92,0x000fb7 },
  1406. { 0x000f9d, 0x000f9c,0x000fb7 },
  1407. { 0x000fa2, 0x000fa1,0x000fb7 },
  1408. { 0x000fa7, 0x000fa6,0x000fb7 },
  1409. { 0x000fac, 0x000fab,0x000fb7 },
  1410. { 0x000fb9, 0x000f90,0x000fb5 },
  1411. { 0x001026, 0x001025,0x00102e },
  1412. { 0x001b06, 0x001b05,0x001b35 },
  1413. { 0x001b08, 0x001b07,0x001b35 },
  1414. { 0x001b0a, 0x001b09,0x001b35 },
  1415. { 0x001b0c, 0x001b0b,0x001b35 },
  1416. { 0x001b0e, 0x001b0d,0x001b35 },
  1417. { 0x001b12, 0x001b11,0x001b35 },
  1418. { 0x001b3b, 0x001b3a,0x001b35 },
  1419. { 0x001b3d, 0x001b3c,0x001b35 },
  1420. { 0x001b40, 0x001b3e,0x001b35 },
  1421. { 0x001b41, 0x001b3f,0x001b35 },
  1422. { 0x001b43, 0x001b42,0x001b35 },
  1423. { 0x001e00, 0x000041,0x000325 },
  1424. { 0x001e01, 0x000061,0x000325 },
  1425. { 0x001e02, 0x000042,0x000307 },
  1426. { 0x001e03, 0x000062,0x000307 },
  1427. { 0x001e04, 0x000042,0x000323 },
  1428. { 0x001e05, 0x000062,0x000323 },
  1429. { 0x001e06, 0x000042,0x000331 },
  1430. { 0x001e07, 0x000062,0x000331 },
  1431. { 0x001e08, 0x0000c7,0x000301 },
  1432. { 0x001e09, 0x0000e7,0x000301 },
  1433. { 0x001e0a, 0x000044,0x000307 },
  1434. { 0x001e0b, 0x000064,0x000307 },
  1435. { 0x001e0c, 0x000044,0x000323 },
  1436. { 0x001e0d, 0x000064,0x000323 },
  1437. { 0x001e0e, 0x000044,0x000331 },
  1438. { 0x001e0f, 0x000064,0x000331 },
  1439. { 0x001e10, 0x000044,0x000327 },
  1440. { 0x001e11, 0x000064,0x000327 },
  1441. { 0x001e12, 0x000044,0x00032d },
  1442. { 0x001e13, 0x000064,0x00032d },
  1443. { 0x001e14, 0x000112,0x000300 },
  1444. { 0x001e15, 0x000113,0x000300 },
  1445. { 0x001e16, 0x000112,0x000301 },
  1446. { 0x001e17, 0x000113,0x000301 },
  1447. { 0x001e18, 0x000045,0x00032d },
  1448. { 0x001e19, 0x000065,0x00032d },
  1449. { 0x001e1a, 0x000045,0x000330 },
  1450. { 0x001e1b, 0x000065,0x000330 },
  1451. { 0x001e1c, 0x000228,0x000306 },
  1452. { 0x001e1d, 0x000229,0x000306 },
  1453. { 0x001e1e, 0x000046,0x000307 },
  1454. { 0x001e1f, 0x000066,0x000307 },
  1455. { 0x001e20, 0x000047,0x000304 },
  1456. { 0x001e21, 0x000067,0x000304 },
  1457. { 0x001e22, 0x000048,0x000307 },
  1458. { 0x001e23, 0x000068,0x000307 },
  1459. { 0x001e24, 0x000048,0x000323 },
  1460. { 0x001e25, 0x000068,0x000323 },
  1461. { 0x001e26, 0x000048,0x000308 },
  1462. { 0x001e27, 0x000068,0x000308 },
  1463. { 0x001e28, 0x000048,0x000327 },
  1464. { 0x001e29, 0x000068,0x000327 },
  1465. { 0x001e2a, 0x000048,0x00032e },
  1466. { 0x001e2b, 0x000068,0x00032e },
  1467. { 0x001e2c, 0x000049,0x000330 },
  1468. { 0x001e2d, 0x000069,0x000330 },
  1469. { 0x001e2e, 0x0000cf,0x000301 },
  1470. { 0x001e2f, 0x0000ef,0x000301 },
  1471. { 0x001e30, 0x00004b,0x000301 },
  1472. { 0x001e31, 0x00006b,0x000301 },
  1473. { 0x001e32, 0x00004b,0x000323 },
  1474. { 0x001e33, 0x00006b,0x000323 },
  1475. { 0x001e34, 0x00004b,0x000331 },
  1476. { 0x001e35, 0x00006b,0x000331 },
  1477. { 0x001e36, 0x00004c,0x000323 },
  1478. { 0x001e37, 0x00006c,0x000323 },
  1479. { 0x001e38, 0x001e36,0x000304 },
  1480. { 0x001e39, 0x001e37,0x000304 },
  1481. { 0x001e3a, 0x00004c,0x000331 },
  1482. { 0x001e3b, 0x00006c,0x000331 },
  1483. { 0x001e3c, 0x00004c,0x00032d },
  1484. { 0x001e3d, 0x00006c,0x00032d },
  1485. { 0x001e3e, 0x00004d,0x000301 },
  1486. { 0x001e3f, 0x00006d,0x000301 },
  1487. { 0x001e40, 0x00004d,0x000307 },
  1488. { 0x001e41, 0x00006d,0x000307 },
  1489. { 0x001e42, 0x00004d,0x000323 },
  1490. { 0x001e43, 0x00006d,0x000323 },
  1491. { 0x001e44, 0x00004e,0x000307 },
  1492. { 0x001e45, 0x00006e,0x000307 },
  1493. { 0x001e46, 0x00004e,0x000323 },
  1494. { 0x001e47, 0x00006e,0x000323 },
  1495. { 0x001e48, 0x00004e,0x000331 },
  1496. { 0x001e49, 0x00006e,0x000331 },
  1497. { 0x001e4a, 0x00004e,0x00032d },
  1498. { 0x001e4b, 0x00006e,0x00032d },
  1499. { 0x001e4c, 0x0000d5,0x000301 },
  1500. { 0x001e4d, 0x0000f5,0x000301 },
  1501. { 0x001e4e, 0x0000d5,0x000308 },
  1502. { 0x001e4f, 0x0000f5,0x000308 },
  1503. { 0x001e50, 0x00014c,0x000300 },
  1504. { 0x001e51, 0x00014d,0x000300 },
  1505. { 0x001e52, 0x00014c,0x000301 },
  1506. { 0x001e53, 0x00014d,0x000301 },
  1507. { 0x001e54, 0x000050,0x000301 },
  1508. { 0x001e55, 0x000070,0x000301 },
  1509. { 0x001e56, 0x000050,0x000307 },
  1510. { 0x001e57, 0x000070,0x000307 },
  1511. { 0x001e58, 0x000052,0x000307 },
  1512. { 0x001e59, 0x000072,0x000307 },
  1513. { 0x001e5a, 0x000052,0x000323 },
  1514. { 0x001e5b, 0x000072,0x000323 },
  1515. { 0x001e5c, 0x001e5a,0x000304 },
  1516. { 0x001e5d, 0x001e5b,0x000304 },
  1517. { 0x001e5e, 0x000052,0x000331 },
  1518. { 0x001e5f, 0x000072,0x000331 },
  1519. { 0x001e60, 0x000053,0x000307 },
  1520. { 0x001e61, 0x000073,0x000307 },
  1521. { 0x001e62, 0x000053,0x000323 },
  1522. { 0x001e63, 0x000073,0x000323 },
  1523. { 0x001e64, 0x00015a,0x000307 },
  1524. { 0x001e65, 0x00015b,0x000307 },
  1525. { 0x001e66, 0x000160,0x000307 },
  1526. { 0x001e67, 0x000161,0x000307 },
  1527. { 0x001e68, 0x001e62,0x000307 },
  1528. { 0x001e69, 0x001e63,0x000307 },
  1529. { 0x001e6a, 0x000054,0x000307 },
  1530. { 0x001e6b, 0x000074,0x000307 },
  1531. { 0x001e6c, 0x000054,0x000323 },
  1532. { 0x001e6d, 0x000074,0x000323 },
  1533. { 0x001e6e, 0x000054,0x000331 },
  1534. { 0x001e6f, 0x000074,0x000331 },
  1535. { 0x001e70, 0x000054,0x00032d },
  1536. { 0x001e71, 0x000074,0x00032d },
  1537. { 0x001e72, 0x000055,0x000324 },
  1538. { 0x001e73, 0x000075,0x000324 },
  1539. { 0x001e74, 0x000055,0x000330 },
  1540. { 0x001e75, 0x000075,0x000330 },
  1541. { 0x001e76, 0x000055,0x00032d },
  1542. { 0x001e77, 0x000075,0x00032d },
  1543. { 0x001e78, 0x000168,0x000301 },
  1544. { 0x001e79, 0x000169,0x000301 },
  1545. { 0x001e7a, 0x00016a,0x000308 },
  1546. { 0x001e7b, 0x00016b,0x000308 },
  1547. { 0x001e7c, 0x000056,0x000303 },
  1548. { 0x001e7d, 0x000076,0x000303 },
  1549. { 0x001e7e, 0x000056,0x000323 },
  1550. { 0x001e7f, 0x000076,0x000323 },
  1551. { 0x001e80, 0x000057,0x000300 },
  1552. { 0x001e81, 0x000077,0x000300 },
  1553. { 0x001e82, 0x000057,0x000301 },
  1554. { 0x001e83, 0x000077,0x000301 },
  1555. { 0x001e84, 0x000057,0x000308 },
  1556. { 0x001e85, 0x000077,0x000308 },
  1557. { 0x001e86, 0x000057,0x000307 },
  1558. { 0x001e87, 0x000077,0x000307 },
  1559. { 0x001e88, 0x000057,0x000323 },
  1560. { 0x001e89, 0x000077,0x000323 },
  1561. { 0x001e8a, 0x000058,0x000307 },
  1562. { 0x001e8b, 0x000078,0x000307 },
  1563. { 0x001e8c, 0x000058,0x000308 },
  1564. { 0x001e8d, 0x000078,0x000308 },
  1565. { 0x001e8e, 0x000059,0x000307 },
  1566. { 0x001e8f, 0x000079,0x000307 },
  1567. { 0x001e90, 0x00005a,0x000302 },
  1568. { 0x001e91, 0x00007a,0x000302 },
  1569. { 0x001e92, 0x00005a,0x000323 },
  1570. { 0x001e93, 0x00007a,0x000323 },
  1571. { 0x001e94, 0x00005a,0x000331 },
  1572. { 0x001e95, 0x00007a,0x000331 },
  1573. { 0x001e96, 0x000068,0x000331 },
  1574. { 0x001e97, 0x000074,0x000308 },
  1575. { 0x001e98, 0x000077,0x00030a },
  1576. { 0x001e99, 0x000079,0x00030a },
  1577. { 0x001e9b, 0x00017f,0x000307 },
  1578. { 0x001ea0, 0x000041,0x000323 },
  1579. { 0x001ea1, 0x000061,0x000323 },
  1580. { 0x001ea2, 0x000041,0x000309 },
  1581. { 0x001ea3, 0x000061,0x000309 },
  1582. { 0x001ea4, 0x0000c2,0x000301 },
  1583. { 0x001ea5, 0x0000e2,0x000301 },
  1584. { 0x001ea6, 0x0000c2,0x000300 },
  1585. { 0x001ea7, 0x0000e2,0x000300 },
  1586. { 0x001ea8, 0x0000c2,0x000309 },
  1587. { 0x001ea9, 0x0000e2,0x000309 },
  1588. { 0x001eaa, 0x0000c2,0x000303 },
  1589. { 0x001eab, 0x0000e2,0x000303 },
  1590. { 0x001eac, 0x001ea0,0x000302 },
  1591. { 0x001ead, 0x001ea1,0x000302 },
  1592. { 0x001eae, 0x000102,0x000301 },
  1593. { 0x001eaf, 0x000103,0x000301 },
  1594. { 0x001eb0, 0x000102,0x000300 },
  1595. { 0x001eb1, 0x000103,0x000300 },
  1596. { 0x001eb2, 0x000102,0x000309 },
  1597. { 0x001eb3, 0x000103,0x000309 },
  1598. { 0x001eb4, 0x000102,0x000303 },
  1599. { 0x001eb5, 0x000103,0x000303 },
  1600. { 0x001eb6, 0x001ea0,0x000306 },
  1601. { 0x001eb7, 0x001ea1,0x000306 },
  1602. { 0x001eb8, 0x000045,0x000323 },
  1603. { 0x001eb9, 0x000065,0x000323 },
  1604. { 0x001eba, 0x000045,0x000309 },
  1605. { 0x001ebb, 0x000065,0x000309 },
  1606. { 0x001ebc, 0x000045,0x000303 },
  1607. { 0x001ebd, 0x000065,0x000303 },
  1608. { 0x001ebe, 0x0000ca,0x000301 },
  1609. { 0x001ebf, 0x0000ea,0x000301 },
  1610. { 0x001ec0, 0x0000ca,0x000300 },
  1611. { 0x001ec1, 0x0000ea,0x000300 },
  1612. { 0x001ec2, 0x0000ca,0x000309 },
  1613. { 0x001ec3, 0x0000ea,0x000309 },
  1614. { 0x001ec4, 0x0000ca,0x000303 },
  1615. { 0x001ec5, 0x0000ea,0x000303 },
  1616. { 0x001ec6, 0x001eb8,0x000302 },
  1617. { 0x001ec7, 0x001eb9,0x000302 },
  1618. { 0x001ec8, 0x000049,0x000309 },
  1619. { 0x001ec9, 0x000069,0x000309 },
  1620. { 0x001eca, 0x000049,0x000323 },
  1621. { 0x001ecb, 0x000069,0x000323 },
  1622. { 0x001ecc, 0x00004f,0x000323 },
  1623. { 0x001ecd, 0x00006f,0x000323 },
  1624. { 0x001ece, 0x00004f,0x000309 },
  1625. { 0x001ecf, 0x00006f,0x000309 },
  1626. { 0x001ed0, 0x0000d4,0x000301 },
  1627. { 0x001ed1, 0x0000f4,0x000301 },
  1628. { 0x001ed2, 0x0000d4,0x000300 },
  1629. { 0x001ed3, 0x0000f4,0x000300 },
  1630. { 0x001ed4, 0x0000d4,0x000309 },
  1631. { 0x001ed5, 0x0000f4,0x000309 },
  1632. { 0x001ed6, 0x0000d4,0x000303 },
  1633. { 0x001ed7, 0x0000f4,0x000303 },
  1634. { 0x001ed8, 0x001ecc,0x000302 },
  1635. { 0x001ed9, 0x001ecd,0x000302 },
  1636. { 0x001eda, 0x0001a0,0x000301 },
  1637. { 0x001edb, 0x0001a1,0x000301 },
  1638. { 0x001edc, 0x0001a0,0x000300 },
  1639. { 0x001edd, 0x0001a1,0x000300 },
  1640. { 0x001ede, 0x0001a0,0x000309 },
  1641. { 0x001edf, 0x0001a1,0x000309 },
  1642. { 0x001ee0, 0x0001a0,0x000303 },
  1643. { 0x001ee1, 0x0001a1,0x000303 },
  1644. { 0x001ee2, 0x0001a0,0x000323 },
  1645. { 0x001ee3, 0x0001a1,0x000323 },
  1646. { 0x001ee4, 0x000055,0x000323 },
  1647. { 0x001ee5, 0x000075,0x000323 },
  1648. { 0x001ee6, 0x000055,0x000309 },
  1649. { 0x001ee7, 0x000075,0x000309 },
  1650. { 0x001ee8, 0x0001af,0x000301 },
  1651. { 0x001ee9, 0x0001b0,0x000301 },
  1652. { 0x001eea, 0x0001af,0x000300 },
  1653. { 0x001eeb, 0x0001b0,0x000300 },
  1654. { 0x001eec, 0x0001af,0x000309 },
  1655. { 0x001eed, 0x0001b0,0x000309 },
  1656. { 0x001eee, 0x0001af,0x000303 },
  1657. { 0x001eef, 0x0001b0,0x000303 },
  1658. { 0x001ef0, 0x0001af,0x000323 },
  1659. { 0x001ef1, 0x0001b0,0x000323 },
  1660. { 0x001ef2, 0x000059,0x000300 },
  1661. { 0x001ef3, 0x000079,0x000300 },
  1662. { 0x001ef4, 0x000059,0x000323 },
  1663. { 0x001ef5, 0x000079,0x000323 },
  1664. { 0x001ef6, 0x000059,0x000309 },
  1665. { 0x001ef7, 0x000079,0x000309 },
  1666. { 0x001ef8, 0x000059,0x000303 },
  1667. { 0x001ef9, 0x000079,0x000303 },
  1668. { 0x001f00, 0x0003b1,0x000313 },
  1669. { 0x001f01, 0x0003b1,0x000314 },
  1670. { 0x001f02, 0x001f00,0x000300 },
  1671. { 0x001f03, 0x001f01,0x000300 },
  1672. { 0x001f04, 0x001f00,0x000301 },
  1673. { 0x001f05, 0x001f01,0x000301 },
  1674. { 0x001f06, 0x001f00,0x000342 },
  1675. { 0x001f07, 0x001f01,0x000342 },
  1676. { 0x001f08, 0x000391,0x000313 },
  1677. { 0x001f09, 0x000391,0x000314 },
  1678. { 0x001f0a, 0x001f08,0x000300 },
  1679. { 0x001f0b, 0x001f09,0x000300 },
  1680. { 0x001f0c, 0x001f08,0x000301 },
  1681. { 0x001f0d, 0x001f09,0x000301 },
  1682. { 0x001f0e, 0x001f08,0x000342 },
  1683. { 0x001f0f, 0x001f09,0x000342 },
  1684. { 0x001f10, 0x0003b5,0x000313 },
  1685. { 0x001f11, 0x0003b5,0x000314 },
  1686. { 0x001f12, 0x001f10,0x000300 },
  1687. { 0x001f13, 0x001f11,0x000300 },
  1688. { 0x001f14, 0x001f10,0x000301 },
  1689. { 0x001f15, 0x001f11,0x000301 },
  1690. { 0x001f18, 0x000395,0x000313 },
  1691. { 0x001f19, 0x000395,0x000314 },
  1692. { 0x001f1a, 0x001f18,0x000300 },
  1693. { 0x001f1b, 0x001f19,0x000300 },
  1694. { 0x001f1c, 0x001f18,0x000301 },
  1695. { 0x001f1d, 0x001f19,0x000301 },
  1696. { 0x001f20, 0x0003b7,0x000313 },
  1697. { 0x001f21, 0x0003b7,0x000314 },
  1698. { 0x001f22, 0x001f20,0x000300 },
  1699. { 0x001f23, 0x001f21,0x000300 },
  1700. { 0x001f24, 0x001f20,0x000301 },
  1701. { 0x001f25, 0x001f21,0x000301 },
  1702. { 0x001f26, 0x001f20,0x000342 },
  1703. { 0x001f27, 0x001f21,0x000342 },
  1704. { 0x001f28, 0x000397,0x000313 },
  1705. { 0x001f29, 0x000397,0x000314 },
  1706. { 0x001f2a, 0x001f28,0x000300 },
  1707. { 0x001f2b, 0x001f29,0x000300 },
  1708. { 0x001f2c, 0x001f28,0x000301 },
  1709. { 0x001f2d, 0x001f29,0x000301 },
  1710. { 0x001f2e, 0x001f28,0x000342 },
  1711. { 0x001f2f, 0x001f29,0x000342 },
  1712. { 0x001f30, 0x0003b9,0x000313 },
  1713. { 0x001f31, 0x0003b9,0x000314 },
  1714. { 0x001f32, 0x001f30,0x000300 },
  1715. { 0x001f33, 0x001f31,0x000300 },
  1716. { 0x001f34, 0x001f30,0x000301 },
  1717. { 0x001f35, 0x001f31,0x000301 },
  1718. { 0x001f36, 0x001f30,0x000342 },
  1719. { 0x001f37, 0x001f31,0x000342 },
  1720. { 0x001f38, 0x000399,0x000313 },
  1721. { 0x001f39, 0x000399,0x000314 },
  1722. { 0x001f3a, 0x001f38,0x000300 },
  1723. { 0x001f3b, 0x001f39,0x000300 },
  1724. { 0x001f3c, 0x001f38,0x000301 },
  1725. { 0x001f3d, 0x001f39,0x000301 },
  1726. { 0x001f3e, 0x001f38,0x000342 },
  1727. { 0x001f3f, 0x001f39,0x000342 },
  1728. { 0x001f40, 0x0003bf,0x000313 },
  1729. { 0x001f41, 0x0003bf,0x000314 },
  1730. { 0x001f42, 0x001f40,0x000300 },
  1731. { 0x001f43, 0x001f41,0x000300 },
  1732. { 0x001f44, 0x001f40,0x000301 },
  1733. { 0x001f45, 0x001f41,0x000301 },
  1734. { 0x001f48, 0x00039f,0x000313 },
  1735. { 0x001f49, 0x00039f,0x000314 },
  1736. { 0x001f4a, 0x001f48,0x000300 },
  1737. { 0x001f4b, 0x001f49,0x000300 },
  1738. { 0x001f4c, 0x001f48,0x000301 },
  1739. { 0x001f4d, 0x001f49,0x000301 },
  1740. { 0x001f50, 0x0003c5,0x000313 },
  1741. { 0x001f51, 0x0003c5,0x000314 },
  1742. { 0x001f52, 0x001f50,0x000300 },
  1743. { 0x001f53, 0x001f51,0x000300 },
  1744. { 0x001f54, 0x001f50,0x000301 },
  1745. { 0x001f55, 0x001f51,0x000301 },
  1746. { 0x001f56, 0x001f50,0x000342 },
  1747. { 0x001f57, 0x001f51,0x000342 },
  1748. { 0x001f59, 0x0003a5,0x000314 },
  1749. { 0x001f5b, 0x001f59,0x000300 },
  1750. { 0x001f5d, 0x001f59,0x000301 },
  1751. { 0x001f5f, 0x001f59,0x000342 },
  1752. { 0x001f60, 0x0003c9,0x000313 },
  1753. { 0x001f61, 0x0003c9,0x000314 },
  1754. { 0x001f62, 0x001f60,0x000300 },
  1755. { 0x001f63, 0x001f61,0x000300 },
  1756. { 0x001f64, 0x001f60,0x000301 },
  1757. { 0x001f65, 0x001f61,0x000301 },
  1758. { 0x001f66, 0x001f60,0x000342 },
  1759. { 0x001f67, 0x001f61,0x000342 },
  1760. { 0x001f68, 0x0003a9,0x000313 },
  1761. { 0x001f69, 0x0003a9,0x000314 },
  1762. { 0x001f6a, 0x001f68,0x000300 },
  1763. { 0x001f6b, 0x001f69,0x000300 },
  1764. { 0x001f6c, 0x001f68,0x000301 },
  1765. { 0x001f6d, 0x001f69,0x000301 },
  1766. { 0x001f6e, 0x001f68,0x000342 },
  1767. { 0x001f6f, 0x001f69,0x000342 },
  1768. { 0x001f70, 0x0003b1,0x000300 },
  1769. { 0x001f72, 0x0003b5,0x000300 },
  1770. { 0x001f74, 0x0003b7,0x000300 },
  1771. { 0x001f76, 0x0003b9,0x000300 },
  1772. { 0x001f78, 0x0003bf,0x000300 },
  1773. { 0x001f7a, 0x0003c5,0x000300 },
  1774. { 0x001f7c, 0x0003c9,0x000300 },
  1775. { 0x001f80, 0x001f00,0x000345 },
  1776. { 0x001f81, 0x001f01,0x000345 },
  1777. { 0x001f82, 0x001f02,0x000345 },
  1778. { 0x001f83, 0x001f03,0x000345 },
  1779. { 0x001f84, 0x001f04,0x000345 },
  1780. { 0x001f85, 0x001f05,0x000345 },
  1781. { 0x001f86, 0x001f06,0x000345 },
  1782. { 0x001f87, 0x001f07,0x000345 },
  1783. { 0x001f88, 0x001f08,0x000345 },
  1784. { 0x001f89, 0x001f09,0x000345 },
  1785. { 0x001f8a, 0x001f0a,0x000345 },
  1786. { 0x001f8b, 0x001f0b,0x000345 },
  1787. { 0x001f8c, 0x001f0c,0x000345 },
  1788. { 0x001f8d, 0x001f0d,0x000345 },
  1789. { 0x001f8e, 0x001f0e,0x000345 },
  1790. { 0x001f8f, 0x001f0f,0x000345 },
  1791. { 0x001f90, 0x001f20,0x000345 },
  1792. { 0x001f91, 0x001f21,0x000345 },
  1793. { 0x001f92, 0x001f22,0x000345 },
  1794. { 0x001f93, 0x001f23,0x000345 },
  1795. { 0x001f94, 0x001f24,0x000345 },
  1796. { 0x001f95, 0x001f25,0x000345 },
  1797. { 0x001f96, 0x001f26,0x000345 },
  1798. { 0x001f97, 0x001f27,0x000345 },
  1799. { 0x001f98, 0x001f28,0x000345 },
  1800. { 0x001f99, 0x001f29,0x000345 },
  1801. { 0x001f9a, 0x001f2a,0x000345 },
  1802. { 0x001f9b, 0x001f2b,0x000345 },
  1803. { 0x001f9c, 0x001f2c,0x000345 },
  1804. { 0x001f9d, 0x001f2d,0x000345 },
  1805. { 0x001f9e, 0x001f2e,0x000345 },
  1806. { 0x001f9f, 0x001f2f,0x000345 },
  1807. { 0x001fa0, 0x001f60,0x000345 },
  1808. { 0x001fa1, 0x001f61,0x000345 },
  1809. { 0x001fa2, 0x001f62,0x000345 },
  1810. { 0x001fa3, 0x001f63,0x000345 },
  1811. { 0x001fa4, 0x001f64,0x000345 },
  1812. { 0x001fa5, 0x001f65,0x000345 },
  1813. { 0x001fa6, 0x001f66,0x000345 },
  1814. { 0x001fa7, 0x001f67,0x000345 },
  1815. { 0x001fa8, 0x001f68,0x000345 },
  1816. { 0x001fa9, 0x001f69,0x000345 },
  1817. { 0x001faa, 0x001f6a,0x000345 },
  1818. { 0x001fab, 0x001f6b,0x000345 },
  1819. { 0x001fac, 0x001f6c,0x000345 },
  1820. { 0x001fad, 0x001f6d,0x000345 },
  1821. { 0x001fae, 0x001f6e,0x000345 },
  1822. { 0x001faf, 0x001f6f,0x000345 },
  1823. { 0x001fb0, 0x0003b1,0x000306 },
  1824. { 0x001fb1, 0x0003b1,0x000304 },
  1825. { 0x001fb2, 0x001f70,0x000345 },
  1826. { 0x001fb3, 0x0003b1,0x000345 },
  1827. { 0x001fb4, 0x0003ac,0x000345 },
  1828. { 0x001fb6, 0x0003b1,0x000342 },
  1829. { 0x001fb7, 0x001fb6,0x000345 },
  1830. { 0x001fb8, 0x000391,0x000306 },
  1831. { 0x001fb9, 0x000391,0x000304 },
  1832. { 0x001fba, 0x000391,0x000300 },
  1833. { 0x001fbc, 0x000391,0x000345 },
  1834. { 0x001fc1, 0x0000a8,0x000342 },
  1835. { 0x001fc2, 0x001f74,0x000345 },
  1836. { 0x001fc3, 0x0003b7,0x000345 },
  1837. { 0x001fc4, 0x0003ae,0x000345 },
  1838. { 0x001fc6, 0x0003b7,0x000342 },
  1839. { 0x001fc7, 0x001fc6,0x000345 },
  1840. { 0x001fc8, 0x000395,0x000300 },
  1841. { 0x001fca, 0x000397,0x000300 },
  1842. { 0x001fcc, 0x000397,0x000345 },
  1843. { 0x001fcd, 0x001fbf,0x000300 },
  1844. { 0x001fce, 0x001fbf,0x000301 },
  1845. { 0x001fcf, 0x001fbf,0x000342 },
  1846. { 0x001fd0, 0x0003b9,0x000306 },
  1847. { 0x001fd1, 0x0003b9,0x000304 },
  1848. { 0x001fd2, 0x0003ca,0x000300 },
  1849. { 0x001fd6, 0x0003b9,0x000342 },
  1850. { 0x001fd7, 0x0003ca,0x000342 },
  1851. { 0x001fd8, 0x000399,0x000306 },
  1852. { 0x001fd9, 0x000399,0x000304 },
  1853. { 0x001fda, 0x000399,0x000300 },
  1854. { 0x001fdd, 0x001ffe,0x000300 },
  1855. { 0x001fde, 0x001ffe,0x000301 },
  1856. { 0x001fdf, 0x001ffe,0x000342 },
  1857. { 0x001fe0, 0x0003c5,0x000306 },
  1858. { 0x001fe1, 0x0003c5,0x000304 },
  1859. { 0x001fe2, 0x0003cb,0x000300 },
  1860. { 0x001fe4, 0x0003c1,0x000313 },
  1861. { 0x001fe5, 0x0003c1,0x000314 },
  1862. { 0x001fe6, 0x0003c5,0x000342 },
  1863. { 0x001fe7, 0x0003cb,0x000342 },
  1864. { 0x001fe8, 0x0003a5,0x000306 },
  1865. { 0x001fe9, 0x0003a5,0x000304 },
  1866. { 0x001fea, 0x0003a5,0x000300 },
  1867. { 0x001fec, 0x0003a1,0x000314 },
  1868. { 0x001fed, 0x0000a8,0x000300 },
  1869. { 0x001ff2, 0x001f7c,0x000345 },
  1870. { 0x001ff3, 0x0003c9,0x000345 },
  1871. { 0x001ff4, 0x0003ce,0x000345 },
  1872. { 0x001ff6, 0x0003c9,0x000342 },
  1873. { 0x001ff7, 0x001ff6,0x000345 },
  1874. { 0x001ff8, 0x00039f,0x000300 },
  1875. { 0x001ffa, 0x0003a9,0x000300 },
  1876. { 0x001ffc, 0x0003a9,0x000345 },
  1877. { 0x00219a, 0x002190,0x000338 },
  1878. { 0x00219b, 0x002192,0x000338 },
  1879. { 0x0021ae, 0x002194,0x000338 },
  1880. { 0x0021cd, 0x0021d0,0x000338 },
  1881. { 0x0021ce, 0x0021d4,0x000338 },
  1882. { 0x0021cf, 0x0021d2,0x000338 },
  1883. { 0x002204, 0x002203,0x000338 },
  1884. { 0x002209, 0x002208,0x000338 },
  1885. { 0x00220c, 0x00220b,0x000338 },
  1886. { 0x002224, 0x002223,0x000338 },
  1887. { 0x002226, 0x002225,0x000338 },
  1888. { 0x002241, 0x00223c,0x000338 },
  1889. { 0x002244, 0x002243,0x000338 },
  1890. { 0x002247, 0x002245,0x000338 },
  1891. { 0x002249, 0x002248,0x000338 },
  1892. { 0x002260, 0x00003d,0x000338 },
  1893. { 0x002262, 0x002261,0x000338 },
  1894. { 0x00226d, 0x00224d,0x000338 },
  1895. { 0x00226e, 0x00003c,0x000338 },
  1896. { 0x00226f, 0x00003e,0x000338 },
  1897. { 0x002270, 0x002264,0x000338 },
  1898. { 0x002271, 0x002265,0x000338 },
  1899. { 0x002274, 0x002272,0x000338 },
  1900. { 0x002275, 0x002273,0x000338 },
  1901. { 0x002278, 0x002276,0x000338 },
  1902. { 0x002279, 0x002277,0x000338 },
  1903. { 0x002280, 0x00227a,0x000338 },
  1904. { 0x002281, 0x00227b,0x000338 },
  1905. { 0x002284, 0x002282,0x000338 },
  1906. { 0x002285, 0x002283,0x000338 },
  1907. { 0x002288, 0x002286,0x000338 },
  1908. { 0x002289, 0x002287,0x000338 },
  1909. { 0x0022ac, 0x0022a2,0x000338 },
  1910. { 0x0022ad, 0x0022a8,0x000338 },
  1911. { 0x0022ae, 0x0022a9,0x000338 },
  1912. { 0x0022af, 0x0022ab,0x000338 },
  1913. { 0x0022e0, 0x00227c,0x000338 },
  1914. { 0x0022e1, 0x00227d,0x000338 },
  1915. { 0x0022e2, 0x002291,0x000338 },
  1916. { 0x0022e3, 0x002292,0x000338 },
  1917. { 0x0022ea, 0x0022b2,0x000338 },
  1918. { 0x0022eb, 0x0022b3,0x000338 },
  1919. { 0x0022ec, 0x0022b4,0x000338 },
  1920. { 0x0022ed, 0x0022b5,0x000338 },
  1921. { 0x002adc, 0x002add,0x000338 },
  1922. { 0x00304c, 0x00304b,0x003099 },
  1923. { 0x00304e, 0x00304d,0x003099 },
  1924. { 0x003050, 0x00304f,0x003099 },
  1925. { 0x003052, 0x003051,0x003099 },
  1926. { 0x003054, 0x003053,0x003099 },
  1927. { 0x003056, 0x003055,0x003099 },
  1928. { 0x003058, 0x003057,0x003099 },
  1929. { 0x00305a, 0x003059,0x003099 },
  1930. { 0x00305c, 0x00305b,0x003099 },
  1931. { 0x00305e, 0x00305d,0x003099 },
  1932. { 0x003060, 0x00305f,0x003099 },
  1933. { 0x003062, 0x003061,0x003099 },
  1934. { 0x003065, 0x003064,0x003099 },
  1935. { 0x003067, 0x003066,0x003099 },
  1936. { 0x003069, 0x003068,0x003099 },
  1937. { 0x003070, 0x00306f,0x003099 },
  1938. { 0x003071, 0x00306f,0x00309a },
  1939. { 0x003073, 0x003072,0x003099 },
  1940. { 0x003074, 0x003072,0x00309a },
  1941. { 0x003076, 0x003075,0x003099 },
  1942. { 0x003077, 0x003075,0x00309a },
  1943. { 0x003079, 0x003078,0x003099 },
  1944. { 0x00307a, 0x003078,0x00309a },
  1945. { 0x00307c, 0x00307b,0x003099 },
  1946. { 0x00307d, 0x00307b,0x00309a },
  1947. { 0x003094, 0x003046,0x003099 },
  1948. { 0x00309e, 0x00309d,0x003099 },
  1949. { 0x0030ac, 0x0030ab,0x003099 },
  1950. { 0x0030ae, 0x0030ad,0x003099 },
  1951. { 0x0030b0, 0x0030af,0x003099 },
  1952. { 0x0030b2, 0x0030b1,0x003099 },
  1953. { 0x0030b4, 0x0030b3,0x003099 },
  1954. { 0x0030b6, 0x0030b5,0x003099 },
  1955. { 0x0030b8, 0x0030b7,0x003099 },
  1956. { 0x0030ba, 0x0030b9,0x003099 },
  1957. { 0x0030bc, 0x0030bb,0x003099 },
  1958. { 0x0030be, 0x0030bd,0x003099 },
  1959. { 0x0030c0, 0x0030bf,0x003099 },
  1960. { 0x0030c2, 0x0030c1,0x003099 },
  1961. { 0x0030c5, 0x0030c4,0x003099 },
  1962. { 0x0030c7, 0x0030c6,0x003099 },
  1963. { 0x0030c9, 0x0030c8,0x003099 },
  1964. { 0x0030d0, 0x0030cf,0x003099 },
  1965. { 0x0030d1, 0x0030cf,0x00309a },
  1966. { 0x0030d3, 0x0030d2,0x003099 },
  1967. { 0x0030d4, 0x0030d2,0x00309a },
  1968. { 0x0030d6, 0x0030d5,0x003099 },
  1969. { 0x0030d7, 0x0030d5,0x00309a },
  1970. { 0x0030d9, 0x0030d8,0x003099 },
  1971. { 0x0030da, 0x0030d8,0x00309a },
  1972. { 0x0030dc, 0x0030db,0x003099 },
  1973. { 0x0030dd, 0x0030db,0x00309a },
  1974. { 0x0030f4, 0x0030a6,0x003099 },
  1975. { 0x0030f7, 0x0030ef,0x003099 },
  1976. { 0x0030f8, 0x0030f0,0x003099 },
  1977. { 0x0030f9, 0x0030f1,0x003099 },
  1978. { 0x0030fa, 0x0030f2,0x003099 },
  1979. { 0x0030fe, 0x0030fd,0x003099 },
  1980. { 0x00fb1d, 0x0005d9,0x0005b4 },
  1981. { 0x00fb1f, 0x0005f2,0x0005b7 },
  1982. { 0x00fb2a, 0x0005e9,0x0005c1 },
  1983. { 0x00fb2b, 0x0005e9,0x0005c2 },
  1984. { 0x00fb2c, 0x00fb49,0x0005c1 },
  1985. { 0x00fb2d, 0x00fb49,0x0005c2 },
  1986. { 0x00fb2e, 0x0005d0,0x0005b7 },
  1987. { 0x00fb2f, 0x0005d0,0x0005b8 },
  1988. { 0x00fb30, 0x0005d0,0x0005bc },
  1989. { 0x00fb31, 0x0005d1,0x0005bc },
  1990. { 0x00fb32, 0x0005d2,0x0005bc },
  1991. { 0x00fb33, 0x0005d3,0x0005bc },
  1992. { 0x00fb34, 0x0005d4,0x0005bc },
  1993. { 0x00fb35, 0x0005d5,0x0005bc },
  1994. { 0x00fb36, 0x0005d6,0x0005bc },
  1995. { 0x00fb38, 0x0005d8,0x0005bc },
  1996. { 0x00fb39, 0x0005d9,0x0005bc },
  1997. { 0x00fb3a, 0x0005da,0x0005bc },
  1998. { 0x00fb3b, 0x0005db,0x0005bc },
  1999. { 0x00fb3c, 0x0005dc,0x0005bc },
  2000. { 0x00fb3e, 0x0005de,0x0005bc },
  2001. { 0x00fb40, 0x0005e0,0x0005bc },
  2002. { 0x00fb41, 0x0005e1,0x0005bc },
  2003. { 0x00fb43, 0x0005e3,0x0005bc },
  2004. { 0x00fb44, 0x0005e4,0x0005bc },
  2005. { 0x00fb46, 0x0005e6,0x0005bc },
  2006. { 0x00fb47, 0x0005e7,0x0005bc },
  2007. { 0x00fb48, 0x0005e8,0x0005bc },
  2008. { 0x00fb49, 0x0005e9,0x0005bc },
  2009. { 0x00fb4a, 0x0005ea,0x0005bc },
  2010. { 0x00fb4b, 0x0005d5,0x0005b9 },
  2011. { 0x00fb4c, 0x0005d1,0x0005bf },
  2012. { 0x00fb4d, 0x0005db,0x0005bf },
  2013. { 0x00fb4e, 0x0005e4,0x0005bf },
  2014. { 0x01d15e, 0x01d157,0x01d165 },
  2015. { 0x01d15f, 0x01d158,0x01d165 },
  2016. { 0x01d160, 0x01d15f,0x01d16e },
  2017. { 0x01d161, 0x01d15f,0x01d16f },
  2018. { 0x01d162, 0x01d15f,0x01d170 },
  2019. { 0x01d163, 0x01d15f,0x01d171 },
  2020. { 0x01d164, 0x01d15f,0x01d172 },
  2021. { 0x01d1bb, 0x01d1b9,0x01d165 },
  2022. { 0x01d1bc, 0x01d1ba,0x01d165 },
  2023. { 0x01d1bd, 0x01d1bb,0x01d16e },
  2024. { 0x01d1be, 0x01d1bc,0x01d16e },
  2025. { 0x01d1bf, 0x01d1bb,0x01d16f },
  2026. { 0x01d1c0, 0x01d1bc,0x01d16f },
  2027. {0,0,0}
  2028. };
  2029. ///////////////////////////////////////////////////////////////////////////////
  2030. const dcUnicodeTripel * DecomposeUnicode ( u32 code )
  2031. {
  2032. int beg = 0;
  2033. int end = sizeof(TableUnicodeDecomp)/sizeof(*TableUnicodeDecomp) - 2;
  2034. while ( beg <= end )
  2035. {
  2036. const int pos = (beg+end)/2;
  2037. const dcUnicodeTripel * ptr = TableUnicodeDecomp+pos;
  2038. if ( code < ptr->code1 )
  2039. end = pos-1;
  2040. else if ( code > ptr->code1 )
  2041. beg = pos+1;
  2042. else
  2043. {
  2044. noTRACE("DecomposeUnicode(%lx) -> %lx,%lx\n",code,ptr->code2,ptr->code3);
  2045. return ptr;
  2046. }
  2047. }
  2048. noTRACE("DecomposeUnicode(%lx) -> NONE\n",code);
  2049. return 0;
  2050. }
  2051. //
  2052. ///////////////////////////////////////////////////////////////////////////////
  2053. /////////////// END ///////////////
  2054. ///////////////////////////////////////////////////////////////////////////////