This COM uses a VC's resource file. It is a dictionary.
We can go 61.134.75.70/download/gb2big5.zip download the original code as follows: '//' Chinese name: GB and BIG5 internal code exchange controls 'English name: GB2BIG5' Author: Blood 'Version: 1.0' Production Time: 2002.3 .5 'copyroll, explicit' Define Variables DIM BIG5DATA AS VARIANTDIM GBDATA AS VARIANT 'Defines Custom Types to process the encoded high-level problem Type chinesepea Lochar as Byte Hichar as Byteend TypePrivate Big5Type (& HA1 TO & HFF, & H40 TO & HFE) AS CHINESTYPEA 'corresponds to the function of the GB Database' // 'public function start' // 'BIG5 to the GB of the GB Fontus' PRIVATE GBTYPE (& ha7 to & hff, & ha1 to & hfe) BIG5TOGB (STRSOURCE AS STRING) AS STRING DIM I as long, y as long 'defines arrays to store BIG5 and GB internal code data DIM BTEBIG5 () AS BYTE DIM BTEGB () AS BYTE' If the input content is empty, then Exit function if strsource = "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" Convert all BIG5 content to GB Code Y = Ubound (btebig5) redim btegb (0 to y) for i = 0 to y if i = y Ten btegb (i) = btebig5 (i) EXIT for END IF B TEBIG5 (I) <& ha1 or btebig5 (i 1) <& H40 Then Btegb (i) = btebig5 (i) else btegb (i) = BIG5TYPE (Btebig5 (i), BTebig5 (i 1)). Lochar Btegb (i 1) = BIG5TYPE (BTebig5 (i), btebig5 (i 1)). Hichar i = i 1 end if next i 'converts the system default code to Unicode encoded BIG5TOGB = STRCONV (BTEGB, vbunicode)' Reinitialization GB array to release memory ERASE BTEGBEND FUNCTION '
GB Transfer to BIG5 Function Function GBTOBIG5 (STRSOURCE AS STRING) AS STRING DIM I as long, y as long 'defines array to store BIG5 and GB internal code data DIM btegb () as byte dim btebig5 () as byte' The input content is empty, then exits the function if strsource = "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" The subscript is used to loop all BIG5 content to GB internal code y = ubound (btegb) redim btebig5 (0 to y) for i = 0 to y if i = y Then btebig5 (i) = btegb (i) EXIT for END IF BTEGB (I) <& ha1 or btegb (i 1) <& ha1 Then Btebig5 (i) = btegb (i) Else IF BTEGB (i) <& HB0 and Btegb (i 1)> = & ha1 Then Btebig5 (I) = GBTYPE (Btegb (i) 6, Btegb (i 1)). Lochar Btebig5 (i 1) = GBTYPE (Btegb (i) 6, Btegb (i 1)). Hichar else btebig5 ( I) = GBTYPE (Btegb (i), BTEGB (i 1)). Lochar btebig5 (i 1) = GBTYPE (Btegb (i), BTEGB (i 1)). Hphar End if i = i 1 end if next i 'converts the system default code to Unicode encoded GBTOBIG5 = STRCONV (BTEBIG5, VBUNICODE)' Reinitializing the BIG5 array to release the memory ERASE BTEBIG5END FUNCTION '//' public function end '/ / 'Class Initialization Private Sub Class_Initialize () DIM I AS Long Dim J AS Long Dim Ilen As Long' Read GB and BIG5 Fonts from the Resource File GBData = LoadResData (102, "Custom") '// Read GB Font Library BIG5DATA = LoadResdata (101, "Custom") '// Read BIG5 Font FOR I = & Ha1 To & Hfe for J = & H40 To & HFE for J = & H40 TO & HFE