** GB2312,编码:区码01--94、位码01--94。
** 双字节汉字编码,前字节:160+区码,后字节:160+位码。
? QWM_HZ(16, 1)
nQM = 0
nWM = 0
? HZ_QWM("啊", @nQM, @nWM)
? nQM
? nWM
RETURN
FUNCTION QWM_HZ(nQM, nWM)
IF BETWEEN(nQM,1,94) AND BETWEEN(nWM,1,94)
RETURN CHR(160+nQM)+CHR(160+nWM)
ENDIF
RETURN ""
ENDFUNC
FUNCTION HZ_QWM(cHZ, nQM, nWM)
IF LEN(cHZ) == 2
nQM = ASC(LEFT(cHZ,1)) - 160
nWM = ASC(RIGHT(cHZ,1)) - 160
IF BETWEEN(nQM,1,94) AND BETWEEN(nWM,1,94)
RETURN PADL(nQM,2,"0")+PADL(nWM,2,"0")
ENDIF
ENDIF
nQM = 0
nWM = 0
RETURN ""
ENDFUNC
[此贴子已经被作者于2017-7-18 16:43编辑过]