You are not logged in.
Pages: 1
Hi ab,
Recently debugging why I am producing invalid JSON content led me to following:
using ObjectToJson and more precisely
procedure DateToIso8601PChar(P: PUTF8Char; Expanded: boolean; Y,M,D: cardinal);
expects the year to be 4 digits, reasonably right expectation.
But in practice, I am transferring objects, containing TDateTime, which are filled/generated based on public data, and there is no guarantee that the year will be correct parsed/provided.
I got some 50895 year, if I remember well, than #0 in the json content.
As I believe we will use mORMot even after 9999 year, so I gladly ask for a fix
P.S.
I still generate invalid UTF8 when streaming data, will further investigate.
Offline
I don't exactly get the problem. Could you post some code to show what you expect?
If you want to validate the date before serialization, it is up to your business/logic layer, not at framework level, I guess.
Offline
Pages: 1