You are not logged in.
The test.txt file content: (has Unicode symbol »)
Read more »
Next Line
Loading file content to the Value property and generating JSON file:
Type
TMyRecord = class(TSQLRecord)
private
FValue : TSQLRawBlob;
published
property Value: TSQLRawBlob read FValue write FValue;
end;
...
FRecord := TMyRecord.Create;
try
FRecord.Value := StringFromFile('d:\test.txt');
ObjectToJSONFile(FRecord, 'd:\output.txt');
finally
FRecord.free;
end;
Output file (the value property does not contain text after »:
{"ID":0,"Value":"Read more "}
I think the problem is in procedure TTextWriter.AddAnyAnsiString(..)
Maybe we should check codepage:
case CodePage of
CP_SQLRAWBLOB:
Add(pointer(s),0,Escape); // direct write of TSQLRawBlob content
....
Offline
I suspect it should be written as base64 text.
See http://synopse.info/fossil/info/ef8602d548
Hope it helps.
Offline