十六進(jìn)制轉(zhuǎn)ascii碼原理 怎么把十六進(jìn)制數(shù),轉(zhuǎn)換成ascii字符?
怎么把十六進(jìn)制數(shù),轉(zhuǎn)換成ascii字符?使用這種方法,由十六進(jìn)制數(shù)字組成的字符串可以轉(zhuǎn)換成UTF-8格式的字符串,public static string to stringhex1(strings)
怎么把十六進(jìn)制數(shù),轉(zhuǎn)換成ascii字符?
使用這種方法,由十六進(jìn)制數(shù)字組成的字符串可以轉(zhuǎn)換成UTF-8格式的字符串,public static string to stringhex1(strings){byte[]bakeyword=newbyte[s.length()/2]for(inti=0I)<baKeyword.lengthi公司){試試{baKeyword[i]=(byte)(0xff&Integer.parseInt(s.子串(i*2,i*2)2) ,16))}catch(異常一){e.printStackTrace()}嘗試{s=newString(baKeyword,“utf-8”)//utf-16le:Not}catch(異常一){e1.printStackTrace()}返回}