anchor.diff:      end;
     end;
   
  -  function CharToHexInt(Chr: ThtChar): Integer;
  -  begin
  -    case Chr of
  -      '0'..'9': Result := Ord(Chr) - Ord('0');
  -      'A'..'F': Result := Ord(Chr) - Ord('A') + 10;
  -      'a'..'f': Result := Ord(Chr) - Ord('a') + 10;
  -    else
  -      raise EConvertError.Create('Not a valid escape character: ''' + Chr + '''');
  -    end;
  -  end;
  -
  -  procedure ReplaceEscapeChars;
  -  var
  -    I: integer;
  -  begin
  -    I := Pos('%', FName);
  -    while (I >= 1) and (I <= Length(FName) - 2) do
  -    begin
  -      try
  -        FName[I] := ThtChar(CharToHexInt(FName[I + 1]) * 16 + CharToHexInt(FName[I + 2])); // chr(StrToInt(S));
  -        Delete(FName, I + 1, 2);
  -      except {ignore exception}
  -        Exit;
  -      end;
  -      I := Pos('%', FName);
  -    end;
  -  end;
  -
  -begin
  -  ReplaceEscapeChars;
  +begin
  +  FName := DecodeURL(FName);
     I := pos('/', FName);
     if I <> 0 then
     begin
  -    I := Pos('file:///', Lowercase(FName));
  +    I := Pos('file:/', Lowercase(FName));
       if I > 0 then
  -      System.Delete(FName, I, 8)
  -    else
  -    begin
  -      I := Pos('file://', Lowercase(FName));
  -      if I > 0 then
  -        System.Delete(FName, I, 7)
  +    begin
  +      N := Length(FName);
  +      if (N < 7) or (FName[7] <> '/') then
  +        N := 6
  +      else if (N < 8) or (FName[8] <> '/') then
  +        N := 7
         else
  -      begin
  -        I := Pos('file:/', Lowercase(FName));
  -        if I > 0 then
  -          System.Delete(FName, I, 6);
  -      end;
  +        N := 8;
  +      System.Delete(FName, I, N);
       end;
       Replace('|', ':');
       Replace('/', '\');
  
positive.code:   Result := FName;
  end;
  
  function HTMLToDos(FName: ThtString): ThtString;
  {convert an HTML style filename to one for Dos}
  var
    I: integer;
  
    procedure Replace(Old, New: ThtChar);
    var
  
negative.code: function GetURLFilenameAndExt(const URL: ThtString): ThtString;
  {returns mixed case after last /}
  
  function DecodeURL(const URL: ThtString): ThtString;
  {return % encoded URL convert to UnicodeString}
  
  {***************************************************************************************************
   * both URL and DOS processing methods
  