RTC Forums

Subscription => Support => Topic started by: jorgen on April 07, 2016, 12:53:56 PM



Title: escape & in DelphiDataSetToRtc
Post by: jorgen on April 07, 2016, 12:53:56 PM
I do this:
class function TServer_Utils.JSONFromDataset(ADataset: TDataSet): String;
var
  rtcDS: TRtcDataSet;
  AHugeString: TRtcHugeString;
begin
  AHugeString := nil;
  rtcDS := TRtcDataSet.Create;
  try
    AHugeString := TRtcHugeString.Create;
    DelphiDataSetToRtc(ADataset, rtcDS); // This function is in the "rtcDB" unit
    rtcDS.to_JSON(AHugeString);
    Result := AHugeString.Get;
  finally
    FreeAndNil(rtcDS);
    FreeAndNil(AHugeString);
  end;
end;

The problem is the if a filed contain & like this
tolist=admin@&subject=Moter&body=Moter&reporttype=1&reportID=20000920&response=Sendt
it is removed (with the word after),
like this:
tolist=admin=Moter=Moter=1=20000920=Sendt


I have updated both Delphi and RTC so i may have forgotten something. This code worked before. Has something changed) Should I change something?

Jørgen