Вниз
Скачать: CL | DM;

URL ENCODING   Найти похожие ветки 

← →
csr   (2003-11-21 11:39) [0]

Как сделать кодирование строки как в TNMURL только под делфи 7, где нет такого компонента? Например абв=%E0%E1%E2


← →
panov ©   (2003-11-21 12:15) [1]

Вот функция кодирования.
Обратную тоже нетрудно написать.

function Decode(Value: String):String;
var
i,L: Integer;
begin
Result := "";
L := 0;
for i := 1 to Length(Value) do
begin
if (Value[i]<>"%") and (Value[i]<>"+") and (L<1) then
begin
Result := Result + Value[i];
end
else
begin
if Value[i]="+" then Result := Result+" "
else if Value[i]="%" then
begin
L := 2;
if (i<Length(Value)-1) then
begin
Result := Result + Chr(StrToInt("$"+Copy(Value,i+1,2))); //Chr(HexToInt(Value[i+1])*16+HexToInt(Value[i+2]));
end;
end
else Dec(L);
end;
end;
end;


← →
Dimka Maslov ©   (2003-11-21 12:55) [2]

http://delphibase.endimus.com/?action=viewfunc&topic=strcode&id=10156
http://delphibase.endimus.com/?action=viewfunc&topic=strcode&id=10157


← →
csr   (2003-11-22 19:26) [3]

Огромное Вам спасибо, господа!



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.007 c
1-83155
snoup
2004-01-15 01:33
2004.01.26
Как сделать свое окно активным в виндоус?


1-83165
Grinder
2004-01-15 00:19
2004.01.26
форма 1х1


1-83206
Sirus
2004-01-14 11:37
2004.01.26
Две формы в DLL и один TDataModule на двоих....


1-83210
DelphiNew
2004-01-15 14:27
2004.01.26
ColorBox


1-83141
01081984
2004-01-15 13:10
2004.01.26
Help me!!




   Наверх