Not sure if it is just forum formatting but the first part came out wrong(?) It looks like you are still a bit confused about which part is python and which is JS, which part is executed where, and also what is the difference between bytes/bytearrays vs strings in python. I think that just the second change would fix that last error.
BTW, Espruino interpreter does not handle utf-8 so ascii would be better. But maybe in this case it makes no difference anyway as json.dumps will hopefully quote non-ascii characters properly.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Not sure if it is just forum formatting but the first part came out wrong(?) It looks like you are still a bit confused about which part is python and which is JS, which part is executed where, and also what is the difference between bytes/bytearrays vs strings in python. I think that just the second change would fix that last error.
BTW, Espruino interpreter does not handle utf-8 so ascii would be better. But maybe in this case it makes no difference anyway as json.dumps will hopefully quote non-ascii characters properly.