ODATA: An invalid character was found in the text content

Hello,

I am trying to publish a table with OData.
The database is FirebirdSQL with CHARSET NONE
Some records containing values with non-Latin characters.

When this data is serialized at the client’s request, an exception is raised with the message “An invalid character was found in the text content.”.

Is there any way to intercept the record or values that caused this situation so that it can be identified without making changes to the DataAbstract classes?

Thanks,
Tiberiu Stoicescu

Hi,

try to pass your data to DA server with UTF8 encoding (data and correspondent http header).

I don’t know if I understood correctly what you recommended me to do.

I have a SQL in TDASchema and the data is published with TDAODataSchemaDispatcher.
The data is entered into the database by another application.

I tried several variants of the database connection string, such as:

‘IBDac?AuxDriver=FB;UseUnicode=True;Server=localhost;Database=date.fdb;UserID=sysdba;Password=xxx;Dialect=3;Charset=UTF8;LibraryName=fbclient.dll;@Protocol=TCP;@Pooled=True;@CharacterSet=UTF8;’

‘IBDac?AuxDriver=FB;UseUnicode=False;Server=localhost;Database=date.fdb;UserID=sysdba;Password=xxx;Dialect=3;Charset=NONE;LibraryName=fbclient.dll;@Protocol=TCP;@Pooled=True;@CharacterSet=NONE;’

Nothing seems to change.
In order to be able to identify which data caused the problem, I modified the method
TROMSXMLNode.SetValue(const Value: Variant); but I don’t think it’s a good option.

Hi,

can you show your OData request that causes this error, pls?
you can drop email to support@ for keeping it in privacy.