anchor.diff:                      lastParamWide:= true;
                       end;
         vtPWideChar,
  -      vtWideString: begin
  -                    ws:= WideString(Args [I].VPWideChar);
  -                    s:= string(ws);
  -                    if s = ws then
  -                       line := line + s
  -                    else begin
  -                        wline:= wline + ws;
  -                        lastParamWide:= true;
  -                        end;
  -                    end;
  +      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;
  
positive.code: 
  
  implementation
  uses TntSystem, TntClasses;
  
  
  procedure SaveToFile(FN: WideString; Str: String);
  
negative.code:      S: AnsiString;
    begin
      if (wline <> '') and (not lastParamWide or force) then begin
          S:= WideStringToUTF8(wline);
          F.WriteBuffer(PChar(S)^, length(S));
          wline:= '';
      end;
  