5,927
社区成员




URL := 'http://so.360.cn/s?src=hao_hot&q=' + EnCode('武汉公交车自燃');
//http://so.360.cn/s?src=hao_hot&q=%E6%AD%A6%E6%B1%89%E5%85%AC%E4%BA%A4%E8%BD%A6%E8%87%AA%E7%87%83
function EnCode(Code: string): string;
var
I: Integer;
Hex: string;
begin
for I := 1 to Length(Code) do
case Code[i] of
' ': Result := Result + '+';
'A'..'Z', 'a'..'z', '*', '@', '.', '_', '-',
'0'..'9', '$', '!', '''', '(', ')':
Result := Result + Code[i];
else
begin
Hex := IntToHex(ord(Code[i]), 2);
if Length(Hex) = 2 then
Result := Result + '%' + Hex
else
Result := Result + '%0' + hex;
end;
end;
end;