Y
yninfo
Unregistered / Unconfirmed
GUEST, unregistred user!
function URLEncode(const msg : String) : String;
var
I : Integer;
begin
Result := '';
for I := 1 to Length(msg) do begin
if msg = ' ' then
Result := Result + '+'
else if msg in ['a'..'z', 'A'..'Z', '0'..'9'] then
Result := Result + msg
else
Result := Result + '%' + IntToHex(ord(msg), 2);
end;
end;
function HexToInt(Tstr:string):longint; //十六进制转十进制
var i,Tlen :integer;
p1:array [0..1] of char;
begin
result:=0;
Tstr:=trim(Tstr);
tlen:=length(Tstr);
for i:=1 to tlen do
begin
StrPcopy(p1,copy(Tstr,i,1));
result:=result*16+Toint(p1[0]);
end
end;
function Toint(Tstr:char) :integer;
begin
if ord((tstr)) >=65 then result:=10+ord(Tstr)-65
else result:=ord(Tstr)-48;
end;
//URLDecode解码思路
function URLDecode(const msg : String) : String;
HexToInt( );
chr(184)+chr(240);
求ms word 中文.doc 文档 通过WEB方式编辑后另存到服务器端后的乱码的解码函数??
var
I : Integer;
begin
Result := '';
for I := 1 to Length(msg) do begin
if msg = ' ' then
Result := Result + '+'
else if msg in ['a'..'z', 'A'..'Z', '0'..'9'] then
Result := Result + msg
else
Result := Result + '%' + IntToHex(ord(msg), 2);
end;
end;
function HexToInt(Tstr:string):longint; //十六进制转十进制
var i,Tlen :integer;
p1:array [0..1] of char;
begin
result:=0;
Tstr:=trim(Tstr);
tlen:=length(Tstr);
for i:=1 to tlen do
begin
StrPcopy(p1,copy(Tstr,i,1));
result:=result*16+Toint(p1[0]);
end
end;
function Toint(Tstr:char) :integer;
begin
if ord((tstr)) >=65 then result:=10+ord(Tstr)-65
else result:=ord(Tstr)-48;
end;
//URLDecode解码思路
function URLDecode(const msg : String) : String;
HexToInt( );
chr(184)+chr(240);
求ms word 中文.doc 文档 通过WEB方式编辑后另存到服务器端后的乱码的解码函数??