Using quotes " and other characters in Mbed Wi-Fi password

Probably a silly question, but how do I include the quote character for the Mbed ESP8266 password
in the mbed_app.json file

I need to use this password:


"nsapi.default-wifi-password": "\"password\""

"nsapi.default-wifi-password": "\"Ft290?Ft101"Ic720#Ts850\""

I tried this:

"nsapi.default-wifi-password": "\"Ft290?Ft101\"Ic720#Ts850\""

But would not compile.

Can anyone help?
Thank you

Hi @star297,

Any \" in mbed_app.json becomes " in your source code. What you did was on point, but that would become


in the C/C++ code - the quotes are unmatched. What we need is add another slash \ in the middle (i.e. \\ in the json.

Could you try

"nsapi.default-wifi-password": "\"Ft290?Ft101\\\"Ic720#Ts850\""

so it becomes a correctly-quoted C/C++ string


in your source file. The compiler eventually compiles it into Ft290?Ft101"Ic720#Ts850.

Thank you Lingkai, nice explanation :+1: that now compiles without errors.