Escape/replace characters in a string

You might try something like this:

var
  Oldstring, Newstring, Part: string;
  i: integer;
  
begin
  Newstring := '';
  for i := 1 to Length(Oldstring) do
    begin
      Part := Copy(Oldstring, i, 1);
      if Part = ':' then
        Part := '\:'
      else if Part = '/' then
        Part := '\/';      
      Newstring := Newstring + Part;
    end;
end.

Oldstring derives from the function extracting the title string, Newstring is the escaped title to be sent to the encoder.

Replaced regards

TSD