* 汉字十进制转换为二进制
N10=ASC('编')
MESSAGEBOX('编')
C02=''
Do While N10>0
n=Mod(N10,2)
N10=int(N10/2)
C02=Str(n,1)+C02
enddo
MESSAGEBOX(C02)
* 汉字二进制转换为十进制
N10=0
FOR lnI=1 TO LEN(c02)
N10=N10+VAL(SUBSTR(C02,lnI,1))*2^(LEN(C02)-lnI)
ENDFOR
MESSAGEBOX(CHR(N10))
?CHR(INT(VAL([0X99])))
?DECTOHEX(31)
?DECTOHEX(ASC([红]))
?DECTOHEX(ASC(SUBS([红],1,1))) + DECTOHEX(ASC(SUBS([红],2,1)))
*--------------------------------------------------------------------------------
*十进制转十六进制函数
*--------------------------------------------------------------------------------
FUNCTION DECTOHE...
示例
如:\u6cb3\u5357\u7701
Clear
? Strconv(Chr(0x6cb3%256) + Chr(Int(0x6cb3/256)), 6) + ;
Strconv(Chr(0x5357%256) + Chr(Int(0x5357/256)), 6) + ;
Strconv(Chr(0x7701%256) + Chr(Int(0x7701/256)), 6)
结果:河南省