Binary Data stored in database cannot be Decoded in Delphi

I have report data stored in a database via the IROStream as shown below:
property ReportData: IROStream read GetReportDataValue;

I need to go direct to the database for this table, instead if via the DA server.
I’m trying to Decode this using the TNetEncoding as shown below:
TNetEncoding.Base64.Decode(FReportData)

This causes the following error:
No mapping for the Unicode character exists in the target multi-byte code page

How can I properly decode this without going through a DA remote server? I need to access directly for a REST web service procedure.

Hi,

this means that you have stored some binary data in DB.
usage of IROStream doesn’t confirm that it was encoded to base64 internally.

Can you send to us such stream for investigation, pls?
What methods were used for encoding data?

RO SDK itself uses these methods (uROCompression.pas):

  • procedure EncodeStream(anInputStream, anOutputStream: TStream; aAddLineBreak: Boolean = True);
  • procedure DecodeStream(anInputStream, anOutputStream: TStream);
  • function EncodeString(anInput: UnicodeString): ROAnsiString;
  • function DecodeString(anInput: ROAnsiString): UnicodeString;
  • function EncodeBytesToString(anInput: TBytes): ROAnsiString;
  • function DecodeStringToBytes(anInput: ROAnsiString): TBytes;
  • function IsBase64(anInput: ROAnsiString): Boolean;

Hi, thanks for your help! I was able to use the DecodeStream method as suggest to unpack the binary data. Thanks again, this is great help for us!
Rick.