You are not logged in.
Pages: 1
The Char/WideChar record field is converted to ASCII code instead of its content:
type
  TCharRecord=
  record
    Value : Char;
  end;
procedure SynJSON;
var
  CharRecord : TCharRecord;
  sJSON      : string;
begin
  CharRecord.Value := 'Y';
  TTextWriter.RegisterCustomJSONSerializerSetOptions(TypeInfo(TCharRecord),[soWriteIgnoreDefault],True);
  sJSON := string(RecordSaveJSON(CharRecord,TypeInfo(TCharRecord),True));
  Memo1.Lines.Text := sJSON;
end;giving {"Value":89} as result instead of {"Value":"Y"}
Would an option be considered to handle such conversion?
Offline
Pages: 1