escaping hash keys
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 8 Sep 2006 17:25:03 +0000 (17:25 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 8 Sep 2006 17:25:03 +0000 (17:25 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6031 dcc99617-32d9-48b4-a31d-7c20da2025e4

OpenSRF/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);