From c139579342573bc76a761040e9d662e7dd0d9147 Mon Sep 17 00:00:00 2001 From: joyfullservice Date: Thu, 23 Sep 2021 11:13:40 -0500 Subject: [PATCH] Escape special characters in JSON key names If a key name includes a special character like a double quote, this should be escaped before outputting as JSON. Fixes #259 --- Version Control.accda.src/modules/modJsonConverter.bas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Version Control.accda.src/modules/modJsonConverter.bas b/Version Control.accda.src/modules/modJsonConverter.bas index 01687bb5..137e1774 100644 --- a/Version Control.accda.src/modules/modJsonConverter.bas +++ b/Version Control.accda.src/modules/modJsonConverter.bas @@ -392,9 +392,9 @@ Public Function ConvertToJson(ByVal JsonValue As Variant, Optional ByVal Whitesp End If If json_PrettyPrint Then - json_Converted = vbNewLine & json_Indentation & """" & json_Key & """: " & json_Converted + json_Converted = vbNewLine & json_Indentation & """" & json_Encode(json_Key) & """: " & json_Converted Else - json_Converted = """" & json_Key & """:" & json_Converted + json_Converted = """" & json_Encode(json_Key) & """:" & json_Converted End If json_BufferAppend json_Buffer, json_Converted, json_BufferPosition, json_BufferLength