I have a C program which generates a JSON string using the Jansson library. The string is then sent over the ZMQ socket to a Python listener, which is trying to use the json library to decode the JSON string. I am having trouble with the JSON decode because I think the quote symbols are getting messed up during the transmission.
In the C, I generate the following JSON Object:
{"ticker":"GOOG"}
with the following code
strcpy(jsonStrArr, "{\"ticker\":\"GOOG\"}\0");
In python, I print out what I receive with the following code:
print 'Received ' + repr(rxStr) +' on Queue_B'
The printout that I'm seeing is:
Received "{u'ticker': u'GOOG'}" on Queue_B
I'm not a JSON expert, but I think the u' is messing up the json.loads() function, because a double quote is required.
I know I need to so something to the jsonStrArr variable, but not sure what?
Thanks in advance.