GB and BIG5 Internal code conversion COM original code
Source: Internet
Author: User
This COM uses a VC resource file. is the dictionary.
We can go to 61.134.75.70/download/gb2big5.zip to download
The original code is as follows:
'//////////////////////////////////////////
' Chinese name: GB and BIG5 internal Code interchange control
' English name: Gb2big5
' Author: Blood
' Version: 1.0
' Production time: 2002.3.5
' All rights reserved Blood 2002-2003
'//////////////////////////////////////////
Option Explicit
' Define variables
Dim Big5data as Variant
Dim Gbdata as Variant
' Defines the custom type, which is used to handle the encoded high and low word problem
Type Chinesetypea
Lochar as Byte
Hichar as Byte
End Type
Private Big5type (&ha1 to &hff, &h40 to &HFE) as Chinesetypea ' corresponds to BIG5 font
Private Gbtype (&ha7 to &hff, &HA1 to &HFE) as Chinesetypea ' corresponds with GB font
'//////////////////
' Public function starts
'//////////////////
' BIG5 functions converted to GB
Function big5togb (strsource As String) as String
Dim I as Long, Y as Long
' defines an array for storing BIG5 and GB of internal code data
Dim bteBIG5 () as Byte
Dim BTEGB () as Byte
' If the input is empty, exit the function
If strsource = "" Then
BIG5TOGB = ""
Exit Function
End If
' Converts the type of the BIG5 array from Unicode encoding to system default code
BteBIG5 = StrConv (strsource, vbFromUnicode)
' Determines the subscript of the BIG5 array, which is used to iterate through the conversion of all BIG5 content to GB inner code
Y = UBound (bteBIG5)
ReDim BTEGB (0 to Y)
For I = 0 to Y
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.