anchor.diff:    line: string;
     wline: WideString;
     lastParamWide: boolean;
  -  x: PShortString;
     ws: wideString;
     s: string;
   
  
positive.code:      S: AnsiString;
    begin
      if (wline <> '') and (not lastParamWide or force) then begin
          S:= string(wline);                   // To make it more compatible with older versions. Only use UTF8 if it's necessary
          if wline <> WideString(S) then
             S:= WideStringToUTF8(wline);
  
          F.WriteBuffer(PChar(S)^, length(S));
          wline:= '';
      end;
  
negative.code:                     lastParamWide:= true;
                      end;
        vtPWideChar,
        vtWideString:
               begin
                  ws:= WideString(Args [I].VPWideChar);
                  if CanSaveAsANSI(ws) then
                     line:= line + string(ws)                   // To make it more compatible with older versions. Only use UTF8 if it's necessary
                  else begin
                      wline:= wline + ws;
                      lastParamWide:= true;
                  end;
               end;
        vtCurrency:   line := line + CurrToStr(Args [I].VCurrency^);
      end; // case
      checkToWrite;
  