anchor.diff:    end;
   end;
   
  -procedure UTF8Delete(var S: string; Index, Size: integer);
  -var
  -  ls: integer;
  -  b: string;
  -  e: string;
  -begin
  -  ls := UTF8Length(S);
  -  if (Index > ls) or (Index <= 0) or (Size <= 0) then
  -    Exit; //==>
  -  b := UTF8Copy(S, 1, Index-1); // beginning string
  -  e := UTF8Copy(S, Index+Size, UTF8Length(S)-(Index+Size-1)); // ending string
  -  S := b + e;
  -end;
  +function Copy8(const s: string; StartCharIndex, CharCount: integer): string;
  +begin
  +  Result := UTF8Copy(s, StartCharIndex, CharCount);
  +end;
  +
  +function Length8(const s: string): integer;
  +begin
  +  Result := UTF8Length(s);
  +end;
  +
  +function Pos8(const SearchForText, SearchInText: string): integer;
  +begin
  +  Result := UTF8Pos(SearchForText, SearchInText);
  +end;
  +
  +procedure Delete8(var S: string; Index, Size: integer);
  +begin
  +  UTF8Delete(S, Index, Size);
  +end;
  +
  +procedure Insert8(const Source: string; var S: string; Index: integer);
  +begin
  +  UTF8Insert(Source, S, Index);
  +end;
  +
   
   end.
   
  
positive.code: function  UTF8CharAtByte(const s: string; BytePos: integer; var aChar: string): integer;
  
  
  implementation
  
  // returns the character index, where the SearchForText starts in SearchInText
  function UTF8Pos(const SearchForText, SearchInText: string): integer;
  var
   p: LongInt;
  begin
    p := System.Pos(SearchForText, SearchInText);
    if p > 0 then
      Result := UTF8Length(PChar(SearchInText), p-1) + 1
    else
      Result := 0;
  end;
  
  // returns substring
  
negative.code:   end;
  end;
  
  // returns the character index, where the SearchForText starts in SearchInText
  function UTF8Pos(const SearchForText, SearchInText: string): integer;
  var
   p: LongInt;
  begin
    p := System.Pos(SearchForText, SearchInText);
    if p > 0 then
      Result := UTF8Length(PChar(SearchInText), p-1) + 1
    else
      Result := 0;
  end;
  
  procedure UTF8Delete(var S: string; Index, Size: integer);
  var
    ls: integer;
    b: string;
    e: string;
  begin
    ls := UTF8Length(S);
    if (Index > ls) or (Index <= 0) or (Size <= 0) then
      Exit; //==>
    b := UTF8Copy(S, 1, Index-1); // beginning string
    e := UTF8Copy(S, Index+Size, UTF8Length(S)-(Index+Size-1)); // ending string
    S := b + e;
  end;
  
  procedure UTF8Insert(const Source: string; var S: string; Index: integer);
  