使用方法:chkGB("Access中国") 返回:英英英英英英简简 Private Function chkGb(strGB As String) As String On Error Resume Next Dim ByteGB() As Byte Dim ByteTemp(1) As Byte Dim leng As Long, idx As Long Dim Offset As Long Dim strResult As String ByteGB = StrConv(strGB, vbFromUnicode) leng = UBound(ByteGB) idx = 0 Do While idx <= leng ByteTemp(0) = ByteGB(idx) ByteTemp(1) = ByteGB(idx + 1) Offset = GBOffset(ByteTemp) If (Offset >= 0) And (Offset <= 8177) Then strResult = strResult & "简" idx = idx + 2 Else strResult = strResult & "英" idx = idx + 1 End If Loop chkGb = strResult End Function Private Function GBOffset(ChrString() As Byte) As Long Dim Dl, Dh Dl = ChrString(0) Dh = ChrString(1) GBOffset = (Dl - 161) * 94 + (Dh - 161) End Function |
|站长邮箱|小黑屋|手机版|Office中国/Access中国
( 粤ICP备10043721号-1 )
GMT+8, 2025-4-2 12:13 , Processed in 0.093583 second(s), 23 queries .
Powered by Discuz! X3.3
© 2001-2017 Comsenz Inc.