Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: JSON Special Characters?

$
0
0
Re: JSON Special Characters?
Web Connection 5.0
Re: JSON Special Characters?
Nov. 13, 2012
02:10 pm
3N60UDR6BShow this entire thread in new window
Gratar Image based on email address
From:Rick Strahl
To:Todd Landrum
I have to check and see what happens. I suspect it has to do with character mapping from Unicode to FoxPro's active code page, but there really shouldn't be a problem with characters below 255. I'll check it out.

Re: blank memo, that's because I trim fields when the JSON is created on the way out (which is the same old code from before). This makes sense for saving bandwidth and because VFP tables are fixed width and so generate a lot of white space and it rarely makes sense to send that to the client.

Cursor serialization isn't meant for two way conversion and was never meant to. In fact until very recently deserialization of arrays wasn't supported at all and certainly you can't serialize back into a cursor (although it'd be reasonably easy to create a helper that does that).

If you need to pass data between client and server with full fidelty then wwXML is a better choice as it exports the data as is and works well for two-way serialization.

+++ Rick ---



Thanks for the speedy work.

I've tested against several different tables and it seems to be pretty solid. I did have some data with chr codes beyond 127. The deserializer turns those into question marks. Will this not support those characters?

(example: Change the name field in your example to chr(150) + chr(146), the n-dash I think and single apostrophe. The returned values for name becomes "??".)

Also, a blank memo field with just a return in it (chr(13) + chr(10)) gets turned into a empty string.



Rick Strahl
West Wind Technologies


from Maui, Hawaii

Making waves on the Web


Viewing all articles
Browse latest Browse all 10393

Trending Articles