Hi,
I need to use special characters (from portuguese, pt-br) like ç, ã and so forth, in a flow, specifically to write to a xml file. At the debug window on node-red, the characters looks all correct but when writing to disk, the special charcaters get messed.
The xml is being writtern as this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><video><title/><keywords>palavras,chave</keywords><description>descri��o</description></video>
the charset of the file is iso-8859-1 as returned by the "file" command
file -bi undefined.xml
text/xml; charset=iso-8859-1
the flow is below (change your file path - msg.filename - at the "format-xml" node)
[{"id":"160cecbf.c27973","type":"inject","z":"4a0b25ab.85b84c","name":"","topic":"","payload":"joão","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":270,"y":1300,"wires":[["c942a09.f98966"]]},{"id":"c942a09.f98966","type":"function","z":"4a0b25ab.85b84c","name":"format xml","func":"var title = msg.payload ;\n\nmsg.payload = \n{ \n \"video\": {\n \"title\" : title,\n \"keywords\" : \"palavras,chave\",\n \"description\": \"descrição\"\n\n }\n}\n \nmsg.filename = \"YOUR_PATH\" + title + \".xml\" ;\n\nreturn msg;","outputs":1,"noerr":0,"x":450,"y":1300,"wires":[["181f599b.af4696"]]},{"id":"181f599b.af4696","type":"xml","z":"4a0b25ab.85b84c","name":"","property":"payload","attr":"","chr":"","x":630,"y":1300,"wires":[["4c14ec7f.c0e354"]]},{"id":"4c14ec7f.c0e354","type":"file","z":"4a0b25ab.85b84c","name":"","filename":"","appendNewline":false,"createDir":true,"overwriteFile":"true","x":790,"y":1300,"wires":[["68469962.d91c58"]]},{"id":"68469962.d91c58","type":"debug","z":"4a0b25ab.85b84c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":970,"y":1300,"wires":[]}]
how can I have the special characters in the written file ?
Many thanks in advance