Have square brackets show up as strings in loaded JSON

I use a json file for all of my words in my game to make it easier for translations. I need to be able to use square brackets when narrators change to signify that. However, I can not get the actual square brackets to show up in the game itself. If I use regular text, like I think I should, nothing shows up except for everything before (to the left of) the brackets. If I use unicodes for the brackets, the text shows up but not the square brackets themselves.

My json string:

“- [Sam] Hello Bob, how are you doing today?”

What shows up in GDevelop:
-

Have you tried escaping the square brackets (precede them with a ‘\’)?

You have funny double quotes round your string.

I’ve just tried it myself, and I have no problem with the square brackets. I’ve used both normal text object and a BBCode text object. How are you reading and displaying the string? Can you give a code snip?

  1. Escaping square brackets doesn’t work. It’s not a json standard, and therefore breaks the entire json and all text in my game.

  2. The funny quotes are converted by GDevelop forum’s text processor. They’re just regular double quotes in the json.

I shared screenshots of
a) the json file
b) how I load the json file into a global variable
3) how we set the text of a BBText object to the text of that global variables (based of the json)

(in the screenshot the GDev code doesn’t match the string pattern of the json screenshot, because it’s in different places, but the problem is the same everywhere i have square brackets)

Update it seems to only be an issue when importing from a json file. I tried testing a regular gdevelop structure variable and there was no issue at all. That’s weird though because the object of the global variable used to the store the json and the object of the normal gdevelop global structure variable are identical. Is there something I’m missing?? @Gruk @Silver-Streak @MrMen

Sidenote: I was able to find a temporary work around but it’s not ideal. If i add a character before the string with the square brackets and concatenate them, then everything works fine again.



Screen Shot 2022-06-02 at 10.50.07 AM