mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
better handle utf8 file output chars
This commit is contained in:
parent
cda11491c2
commit
b9b5eaccae
@ -42,6 +42,7 @@ module.exports = function(RED) {
|
||||
if (typeof data === "boolean") { data = data.toString(); }
|
||||
if (typeof data === "number") { data = data.toString(); }
|
||||
if ((this.appendNewline) && (!Buffer.isBuffer(data))) { data += os.EOL; }
|
||||
data = new Buffer(data);
|
||||
if (this.overwriteFile === "true") {
|
||||
// using "binary" not {encoding:"binary"} to be 0.8 compatible for a while
|
||||
fs.writeFile(filename, data, "binary", function (err) {
|
||||
|
Loading…
Reference in New Issue
Block a user