escaping hash keys
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 8 Sep 2006 17:25:03 +0000 (17:25 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 8 Sep 2006 17:25:03 +0000 (17:25 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@783 9efc2488-bf62-4759-914b-345cdb29e865

src/objson/object.c

index cdd4a4b..c781c30 100644 (file)
@@ -504,7 +504,13 @@ char* jsonObjectToJSON( const jsonObject* obj ) {
                        while( (tmp = jsonObjectIteratorNext(itr)) ) {
 
                                buffer_add(buf, "\"");
-                               buffer_add(buf, tmp->key);
+
+                               char* key = tmp->key;
+                               int len = strlen(key);
+                               char* output = uescape(key, len, 1);
+                               buffer_add(buf, output);
+                               free(output);
+
                                buffer_add(buf, "\":");
                                char* data =  jsonObjectToJSON(tmp->item);