#1 2015-10-14 16:58:20

mik
Member
Registered: 2015-10-14
Posts: 8

incorrect JSON serialization of TStrings or TRawUTF8List?

I use in TSQLRecord-based class a field defined as TRawUTF8List or TStringList.
When this field is stored in the database - the resulting JSON string contains some garbage (after the correct list representation).
for example, if the list has two values "a" and "b", it may be stored as this:

["a","b"]garbage...garbage...garbage...

It looks like the trailing \0 is missing when the JSON string is formed.

This happens in the Debug mode (i.e. when allocated memory is not filled with zeros)

Offline

#2 2015-10-14 17:12:46

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,238
Website

Re: incorrect JSON serialization of TStrings or TRawUTF8List?

Are you sure you are using the latest version of the source code try (nightly .zip)?

AFAIR we fixed such an issue some days ago.

Offline

#3 2015-10-14 17:20:54

mik
Member
Registered: 2015-10-14
Posts: 8

Re: incorrect JSON serialization of TStrings or TRawUTF8List?

thanks for the prompt reply. before posting, I downloaded the latest nightly build and recompiled - but apparently I looked at the wrong record... just double-checked  - and it works correctly! sorry about the false alarm.

Offline

Board footer

Powered by FluxBB