delphi7ascii字符轉(zhuǎn)string(精編版)_第1頁(yè)
delphi7ascii字符轉(zhuǎn)string(精編版)_第2頁(yè)
delphi7ascii字符轉(zhuǎn)string(精編版)_第3頁(yè)
全文預(yù)覽已結(jié)束

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、delphi 7 ascii 字符轉(zhuǎn) string 標(biāo)題: delphi 7 ascii 字符轉(zhuǎn) string 標(biāo)題:var monid, goods:pdword; i,pi:dword; goodsname:pwidechar; strname:string;begin memo1.clear; for i:=1 to $100 do begin goods:=pointer($11c1908+$9400+i*4); pi:=goods; if pi>0 then begin goodsname:=pointer(goods+4); goods:=pointer(goods+

2、$4); goodsname:=pointer(goods); strname:=widechartostring(goodsname); /寬字符轉(zhuǎn) string 這里的 unicode的字符數(shù)據(jù)* if strname=11 then continue; memo1.lines.add(strname); end; end; 上面的是用unicode的字符串goodsname 我想換成 ascii 的字符串來(lái)顯示出 dword 里面的漢字, 知道 pwidechar; 這個(gè)指向 widechar 的指針不知道是這個(gè)指針不對(duì)還是別的鞋錯(cuò)了,我其他都沒(méi)錯(cuò),就是不會(huì)轉(zhuǎn)換成文本文字,困了我?guī)滋欤^

3、疼這是我以前寫(xiě)的讀取二代身份證里信息用到的,不知道對(duì)你有幫助不?見(jiàn)笑了。function unicodetoansi(subunicode: string):string; /將unicode 碼轉(zhuǎn)換為漢字var a:array0.500 of char; s1,s2:char; substr1,substr2,s:string; str:string; i:integer; begin if length(subunicode) mod 4 = 0 then begin str:=; for i:=1 to length(subunicode) div 4 do begin s:=; sub

4、str1:=copy(subunicode,i*4-3,2); substr2:=copy(subunicode,i*4-1,2); s1:=chr(hextoint(substr1); s2:=chr(hextoint(substr2); s:=s+s2+s1; strpcopy(a,s); str:=str+copy(widechartostring(a0),1,2); end; result:=str; end; end;function hextoint(hex:string):cardinal; const chex=0123456789abcdef; var mult,i,loop:integer; begin result:=0; mult:=1; for loop:=length(hex)downto 1 do begin i:=pos(hexloop,chex)-1; if (i<0) then i:=0;

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論