class function TMxtTmProto.EncodeMsgData(const rawData: string): string;
var
i:Integer;
len:Integer;
begin
Result := '';
len := length(rawData);
for i:=1 to len do
begin
if (Byte(rawData[i]) = $01) or (Byte(rawData[i]) = $04) or
(Byte(rawData[i]) = $10) or (Byte(rawData[i]) = $11) or
(Byte(rawData[i]) = $13) then
begin
Result := Result + Chr($10);
Result := Result + Chr(Byte(rawData[i]) + $20);
end
else
Result := Result + RawData[i];
end;
end;
将字符串中的0x01 换成0x1021
0x04 换成0x1024
0x10 换成0x1030
0x11 换成0x1031
0x13 换成0x1033