Special character handling

Hi all,

I have a nodered flow in place which has a fucntion node which recieves a json input. Inside the json input there's a key named "Cold Plate Temperature (°C)". And in the function node I'm defining a variable as

var coldPlateTemperatureKeyName = 'Cold Plate Temperature (°C)'

which is then used to derefence the json object like so

msg.payload.NonFastDaq.Demo_PMNTPLUS.values[coldPlateTemperatureKeyName]

Now, this works perfectly for the most of the time, but sometimes nodered ramdomly changes the 'Cold Plate Temperature (°C)' to 'Cold Plate Temperature (�C)' either in code of function node or in the input json object (screenshots attached) which then results in an error where the key is not found in the object and creates issues.


Any leads on how this can be avoided?

Thanks

What version of Node-RED do you have?

Node-Red version is 4.0.2-22

There was a similar report about scented characters here: node-red - node name with accented characters not displayed correctly - lead to deployment issue · Issue #4871 · node-red/node-red · GitHub - might be related.

Although the cause is unknown, it does seem to have disappeared in later versions of node-red.

Ok so i should just update to 4.0.3?

You can, but there are other (different) issues in that one - I'd recommend latest (4.0.5)

I had the same problem with the degree symbol (U+00B0) and I ended up replacing the symbol with the stanza decodeURIComponent('%C2%B0'). What was happening was that the symbol was being replaced when I saved my flows.