UNICODE編碼問題

2021-04-08 22:42:04 字數 1988 閱讀 8140

unicode編碼問題

今天在eclipse裡面看jode(jad) class反編譯出來的**,發現漢字都用unicode標示,理解起來非常不方便,

例如:/u65b0/u95fb/u680f/u76ee/u8bbe/u7f6e 

就是漢字:「新聞欄目設定」

為了察看方便,特寫一段vb**來快速轉換:

public function find(byval strcodes as string) as string

on error resume next

dim strret, strtemp as string

strret = ""

strtemp = ""

dim pos as integer

pos = 0

dim lngcode as long

dim strtemp2 as string

dim strlist() as string

strlist = split(strcodes, "/")

for pos = 0 to ubound(strlist)

'        debug.print strlist(pos)

'        strtemp = findhz(strlist(pos))

'        debug.print right(strlist(pos), 4)

strtemp2 = strlist(pos)

if len(strtemp2) > 0 then

if len(strtemp2) = 5 then

if left(strtemp2, 1) = "u" then

lngcode = clng("&h" & right(strtemp2, 4))

strtemp = chrw$(lngcode)

else

strtemp = strtemp2

end if

else

if len(strtemp2) > 5 then

if left(strtemp2, 1) = "u" then

lngcode = clng("&h" & mid(strtemp2, 2, 4))

strtemp = chrw$(lngcode)

strtemp = strtemp & right(strtemp2, len(strtemp2) - 5)

else

strtemp = strtemp2

end if

else

strtemp = strtemp2

end if

end if

if len(strtemp) > 0 then

strret = strret & strtemp

else

strret = strret & "x"

end if

end if

'        debug.print strret

next

'    do while (pos >= 0)

'        pos = instr(0, strcodes, "u", vbtextcompare)

'        split

'        debug.print pos

'        strtemp = mid(strcodes, pos, 5)

'        debug.print strtemp

'        strcodes = right(strcodes, len(strcodes) - pos - 5)

'        debug.print strcodes

''        strret = strret & findhz(strtemp)

''    loop

find = strret

'    clipboard.settext strret, vbcftext

end function

字元編碼 unicode編碼

1.ascii american standard code for information interchange 美國資訊交換標準 這是計算機上最早使用的通用的編碼方案。那個時候計算機還只是拉丁文字的專利,根本沒有想到現在計算機的發展勢頭,如果想到了,可能一開始就會使用unicode了。當時絕大...

unicode 編碼雜記

unicode,統一碼,可包含世界上所有國家的字元,每一個字元用兩個位元組表示!utf 16,基本上就是unicode雙位元組編碼方式的實現,再加上一個未來擴充套件需求的編碼機制 utf 8,unicode的不等幅編碼機制,英文保持不變,其他用兩個或三個位元組表示,如中文用三個位元組表示 ucs 2...

Unicode字元編碼

ascii碼 最早的字元編碼,使用一個byte的7位來表示128種字元 控制字元,控制符,小寫字母,大寫字母,數字,標點,運算子等 然而對於英語國家來說,基本夠用 但對於使用非英文字元的國家來說,就不夠用了。擴充套件ascii碼 為了滿足需要,各國在相容ascii碼的基礎上對128 155等位元組進...

unicode編碼學習

size medium unicode字符集是我們世界上最完善最全面的字符集,幾乎包含了世界上所有的字元。其實可以這麼理解,unicode字符集是一張巨大的 把世界上各種語言的字元和標點符號都編排到裡面,然後按照一定的順序給每個字元排號 很遺憾的是對於中文來說,這個順序不是按照漢語拼音的順序 有了這...

編碼解碼UNICODE

1.字符集vs字元編碼,編碼 解碼 character code point bytes 前兩者字符集的關係,可以統稱為codepoint 從codepoint到在計算機上的儲存形式,稱為編碼,反過來稱為解碼 字符集 單個符號 character 對應一個無符號數字 通常16進製表示,稱為 點cod...