proliferation of backslashes during dictionary json "export"

Discussion and feedback on Construct 2

Post » Fri Nov 28, 2014 6:15 am

Hi,

In my game I have a dictionary that holds the json of another dictionary that holds the json of another dictionary that holds ... you get it ... about 5 levels down ...

When i export the json of the "root" dictionary and save the generated text in a file I get a backslash "\" (probably escape chars) for each json in json, so i end up with a file that has lots of these \\\\\" \\\\\".

Is this a bug of a feature? I.e. is this necessary for json export import to work or is this a bug.
B
8
S
4
G
1
Posts: 205
Reputation: 1,354

Post » Fri Nov 28, 2014 10:32 am

" and ' need are the standard string encapsulation markers. Everything inside "" or "" is the value of the string.

"this is a string"
'string is a string'

So what happens if you have "This is a "embedded" string"?
Is Embedded inside a string? no it's not. infact this would just break the string and now the word embedded is out the string and sitting in the code as meaning less code. That then breaks code and not just the string.

There are two solutions.
"this is an 'embedded' string where we switch string closing types"
or
'this is another \"embedded string string where we use an embedding marker for nesting more \\"strings inside\\" other\" strings"
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,038

Post » Fri Nov 28, 2014 10:50 am

ok.thanks. its a feature :-)
B
8
S
4
G
1
Posts: 205
Reputation: 1,354


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 9 guests