RTC Forums
March 28, 2024, 04:20:06 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: escape & in DelphiDataSetToRtc  (Read 2683 times)
jorgen
RTC Expired
*
Posts: 20


« 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

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.02 seconds with 16 queries.