[Mono-dev] JSON Deserialization

Troy Hamilton troy.a.hamilton at gmail.com
Sun Apr 24 13:03:27 EDT 2011


On Sun, Apr 24, 2011 at 8:53 AM, Antoine Cailliau <antoinecailliau at gmail.com
> wrote:

> Hi folks,
>
>  This piece of code fails to work on Mono.


> ("[{Name:'1'}, {Name:'2'}]"));
>
> The raised exception is
>
>        Unhandled Exception:
> System.Runtime.Serialization.SerializationException: Deserialization
> has failed ---> System.Xml.XmlException: Unexpected token: '
>
>
Can you try replacing the single quotes with escaped double quotes and see
what you get?

"[{Name:\"1\"}, {Name:\"2\"}]"

I've run into a json libraries before that deal with single quotes allright,
but I believe the standard is to use double quotes.


Good luck,

Troy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20110424/36541e19/attachment.html 


More information about the Mono-devel-list mailing list