unit Convert;

interface
Function ConvertText(TextToConvert:String):String;
implementation
Function ConvertText(TextToConvert:String):String;
Var
N,M:Integer;
ConvertedText:String;
Procedure Change(S:String);
Begin
Delete(ConvertedText,N,1);
Insert(S,ConvertedText,N);
Inc(N,2);
Inc(M,2)
End;
Begin {ConvertText}
ConvertedText:=TextToConvert;
M:=Length(ConvertedText);
N:=1;
While N <= M Do
Begin
Case ConvertedText[N] Of
'!':Change('%21');
' ':Change('%20');
',':Change('%2C');
'?':Change('%3F');
'.':Change('%2E');
':':Change('%3A');
';':Change('%3B');
#13:Change('%0D');
#10:Change('%0A');

End;
Inc(N);
End;
Result:=ConvertedText;

End;  {ConvertText}
end.
