unicode編碼轉換中文,python的unicode編碼轉換( 二 )


lsGroup64 = Midb(asContents, lnPosition, 4)
Char1 = InStrb(sBASE_64_CHARACTERS, Midb(lsGroup64, 1, 1)) - 1
Char2 = InStrb(sBASE_64_CHARACTERS, Midb(lsGroup64, 2, 1)) - 1
Char3 = InStrb(sBASE_64_CHARACTERS, Midb(lsGroup64, 3, 1)) - 1
Char4 = InStrb(sBASE_64_CHARACTERS, Midb(lsGroup64, 4, 1)) - 1
Byte1 = Chrb(((Char2 And 48) \ 16) Or (Char1 * 4) And &HFF)
Byte2 = lsGroupBinary & Chrb(((Char3 And 60) \ 4) Or (Char2 * 16) And &HFF)
Byte3 = Chrb((((Char3 And 3) * 64) And &HFF) Or (Char4 And 63))
lsGroupBinary = Byte1 & Byte2 & Byte3
lsResult = lsResult & lsGroupBinary
Next
'處理最后剩余的幾個字符
if M4 > 0 then
lsGroupBinary = ""
lsGroup64 = Midb(asContents, len2+1, m4) & chrB(65) 'chr(65)=A,轉換成值為0
if M4=2 then '補足4位,是為了便于計算
lsGroup64 = lsGroup64 & chrB(65)
end if
Char1 = InStrb(sBASE_64_CHARACTERS, Midb(lsGroup64, 1, 1)) - 1
Char2 = InStrb(sBASE_64_CHARACTERS, Midb(lsGroup64, 2, 1)) - 1
Char3 = InStrb(sBASE_64_CHARACTERS, Midb(lsGroup64, 3, 1)) - 1
Char4 = InStrb(sBASE_64_CHARACTERS, Midb(lsGroup64, 4, 1)) - 1
Byte1 = Chrb(((Char2 And 48) \ 16) Or (Char1 * 4) And &HFF)
Byte2 = lsGroupBinary & Chrb(((Char3 And 60) \ 4) Or (Char2 * 16) And &HFF)
Byte3 = Chrb((((Char3 And 3) * 64) And &HFF) Or (Char4 And 63))
if M4=2 then
lsGroupBinary = Byte1
elseif M4=3 then
lsGroupBinary = Byte1 & Byte2
end if
lsResult = lsResult & lsGroupBinary
end if
Base64decode = lsResult
End Function
%>

unicode編碼轉換中文,python的unicode編碼轉換

文章插圖

Unicode編碼轉換:
unicode編碼轉換中文,python的unicode編碼轉換

文章插圖
20 90 A6 68 7F 89 38 6E 33 00
【unicode編碼轉換中文,python的unicode編碼轉換】如何將unicode編碼轉換成普通的utf-8或者ISO編碼:
unicode編碼轉換中文,python的unicode編碼轉換

文章插圖
將Unicode的文字或圖形符號直接用UTF-8字符集打開即可,因為UTF-8的字符來源于Unicode,只是其字符數較少而已 。對于UTF-8不能顯示出的字符,就得逐個制成圖片格式進行替換和修改了 。一些自動處理軟件將繁體字或日韓漢字及異體字自動用簡體漢字進行替換,這樣替換出來的文句顯得不倫不類,不符合規范 。
數字怎樣轉成UNICODE碼?:
unicode編碼轉換中文,python的unicode編碼轉換

文章插圖

推薦閱讀