JsonSerializer produces invalid JSON

85 views
Skip to first unread message

TM

unread,
Aug 1, 2012, 3:54:21 AM8/1/12
to servic...@googlegroups.com
Hi,

I just found something that is for sure very strange, but maybe you want to fix this. I query a database that is not under my control and get a character in a string, that causes the serializer to produce invalid JSON - in my opinion to be careful :)

I tracked it down to a single char. You can reproduce it with this call:

ServiceStack.Text.JsonSerializer.SerializeToString("hello"+(char)8232)

I know that added char is a bit strange. The result is a string with a linebreak inside. The client coded in EXT can't deserialize this string. JQuery also seems to have problems.
I coded a workaround, but maybe this could be fixed at the right place.

Regards

TM

unread,
Aug 2, 2012, 6:37:52 AM8/2/12
to servic...@googlegroups.com
After some investigation it seems, that the parser in the ext-framework doesn't make it right. The json2-parser can parse the json.

Please ignore the question :)

Regards
Reply all
Reply to author
Forward
0 new messages