读书人

急十进制ascii码转换成string时出现乱

发布时间: 2012-12-16 12:02:32 作者: rapoo

急急急!十进制ascii码转换成string时出现乱码,请问怎么解决?
我用spcomm采集数据,返回的是十进制ascii码,其中有大于128的数据,转换成string时出现乱码,要怎么解决,求大家帮忙啊

Delphi(Pascal) code
 var    hexbuf:array[1..2048] of byte;    i:integer;    recedata:Pchar;begin   move(buffer^,pchar(@hexbuf)^,bufferlength);[color=#FF0000]//@hexbuf 中存储的十进制ascii码  @hexbuf(36,84,50,48,49,49,48,54,50,50,49,48,52,52,176,67,48,49,164,48,176.......)[/color]        recedata:=@hexbuf;[color=#FF0000]//就是在这一步时,recedata中出现乱码( recedata=$T20110622104801??4595??02??3743??03??3729??04??3887??05??3396?? )[/color]...

读书人网 >.NET

热点推荐