Re: [xHarbour-developers] JSon difference

2011-04-02 Thread Ron Pinkas
Hi Przemek, >> >JSON format does not support dates and timestamp values. >> >So when you pass date item to be converted to JSON format >> >we have 3 choices: >> >1. generate RTE >> >2. convert date to some other format, accepted by JSON, i.e. >> > "MMDD" strings >> >3. store it as NIL/NULL va

Re: [xHarbour-developers] JSon difference

2011-04-01 Thread Przemysław Czerpak
On Fri, 01 Apr 2011, Ron Pinkas wrote: Hi Ron, > >JSON format does not support dates and timestamp values. > >So when you pass date item to be converted to JSON format > >we have 3 choices: > >1. generate RTE > >2. convert date to some other format, accepted by JSON, i.e. > > "MMDD" strings

Re: [xHarbour-developers] JSon difference

2011-04-01 Thread Patrick Mast, xHarbour.
Hey Ron, > We could also consider a 4th choice, I.e. when converting date to string in > the wrapper add extra flag to the string such that when it is decoded the > wrapper will again convert the JSON decoded string to a date value. This of > course means that the string coded by JSON will read so

Re: [xHarbour-developers] JSon difference

2011-04-01 Thread Ron Pinkas
>> Was thinking.. If we change hb_jsonencode() to also use Date's, will >> the output than be JSon compatible? I mean, I need to be able to read >> the JSon string with another language that supports JSon strings. >> Any thoughts? ;-) > > JSON format does not support dates and timestamp values. > S

Re: [xHarbour-developers] JSon difference

2011-04-01 Thread Andi Jahja
On Fri, 1 Apr 2011 14:15:44 +0200 "Patrick Mast, xHarbour." wrote: > Hey Andi, > > > The encoding does accept DATE and TIMEFLAG. Or am I missing something? > > Please look at this sample: > > JSon:=hb_jsonencode(Date(), .F.) > ? hb_jsondecode(JSon, @dDate) // Returns "20110331" instead of a da

Re: [xHarbour-developers] JSon difference

2011-04-01 Thread Patrick Mast, xHarbour.
Hey Andi, > The encoding does accept DATE and TIMEFLAG. Or am I missing something? Please look at this sample: JSon:=hb_jsonencode(Date(), .F.) ? hb_jsondecode(JSon, @dDate) // Returns "20110331" instead of a date var So, it seems it does not recognize the Date value when decoding. ;-) Patric

Re: [xHarbour-developers] JSon difference

2011-04-01 Thread Przemysław Czerpak
On Fri, 01 Apr 2011, Patrick Mast, xHarbour.com Inc. wrote: Hi Patrick, > Was thinking.. If we change hb_jsonencode() to also use Date's, will > the output than be JSon compatible? I mean, I need to be able to read > the JSon string with another language that supports JSon strings. > Any thoughts

Re: [xHarbour-developers] JSon difference

2011-04-01 Thread Andi Jahja
Hi, The encoding does accept DATE and TIMEFLAG. Or am I missing something? Andi On Fri, 1 Apr 2011 13:56:38 +0200 "Patrick Mast, xHarbour." wrote: > Hello, > > Was thinking.. If we change hb_jsonencode() to also use Date's, will > the output than be JSon compatible? I mean, I need to be able

Re: [xHarbour-developers] JSon difference

2011-04-01 Thread Patrick Mast, xHarbour.
Hello, Was thinking.. If we change hb_jsonencode() to also use Date's, will the output than be JSon compatible? I mean, I need to be able to read the JSon string with another language that supports JSon strings. Any thoughts? ;-) Thanks! Patrick On Fri, Apr 1, 2011 at 1:49 PM, Andi Jahja wrot

Re: [xHarbour-developers] JSon difference

2011-04-01 Thread Andi Jahja
On Fri, 1 Apr 2011 09:03:52 +0200 "Patrick Mast, xHarbour." wrote: > Hello Mindaugas, > > >> JSon:=hb_jsonencode(Date(), .F.) > >> ? hb_jsondecode(JSon, @dDate) // Returns "20110331" instead of a date var > > > > JSON encoding does not have date type, so, I've implemented date to > > character

Re: [xHarbour-developers] JSon difference

2011-04-01 Thread Patrick Mast, xHarbour.
Hello Mindaugas, >> JSon:=hb_jsonencode(Date(), .F.) >> ? hb_jsondecode(JSon, @dDate) // Returns "20110331" instead of a date var > > JSON encoding does not have date type, so, I've implemented date to > character string mapping in hb_jsonEncode() in Harbour. If xHarbour's > JSON implementation is

Re: [xHarbour-developers] JSon difference

2011-03-31 Thread Mindaugas Kavaliauskas
Hi, On 2011.03.31 17:06, Patrick Mast, xHarbour. wrote: > JSon:=hb_jsonencode(Date(), .F.) > ? hb_jsondecode(JSon, @dDate) // Returns "20110331" instead of a date var JSON encoding does not have date type, so, I've implemented date to character string mapping in hb_jsonEncode() in Harbour. If x

[xHarbour-developers] JSon difference

2011-03-31 Thread Patrick Mast, xHarbour.
Hello, JSon returns a string instead of a date in this sample: FUNCTION Main LOCAL dDate,JSon JSon:=hb_jsonencode(Date(), .F.) ? hb_jsondecode(JSon, @dDate) // Returns "20110331" instead of a date var RETURN NIL Patrick ---