From ea5a70e03daf76497a4b1af27fdcbc315a8fa02b Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Tue, 26 Sep 2023 11:24:12 +0900 Subject: [PATCH] Update pipe-ipc.js --- lib/pipe-ipc.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/pipe-ipc.js b/lib/pipe-ipc.js index 665f909..27feffb 100644 --- a/lib/pipe-ipc.js +++ b/lib/pipe-ipc.js @@ -436,6 +436,8 @@ function PipeIPC() { }; this.readTextFromFile = function(filename, charset) { + charset = (typeof charset !== "undefined" ? charset : this.charset); + var text = ''; var isFileExists = checkFileExists(filename); @@ -463,12 +465,14 @@ function PipeIPC() { }; this.loadFromFile = function(filename, charset) { - charset = (typeof charset !== "undefined" ? this.charset : charset); + charset = (typeof charset !== "undefined" ? charset : this.charset); + this.write(this.readTextFromFile(filename, charset), ForWriting); }; this.reload = function(charset) { - charset = (typeof charset !== "undefined" ? this.charset : charset); + charset = (typeof charset !== "undefined" ? charset : this.charset); + this.loadFromFile(this.path, charset); }; } @@ -498,7 +502,7 @@ exports.adSaveCreateNotExist = adSaveCreateNotExist; exports.adSaveCreateOverWrite = adSaveCreateOverWrite; exports.adModeReadWrite = adModeReadWrite; -exports.VERSIONINFO = "PIPE-based IPC Module (pipe-ipc.js) version 0.1.18"; +exports.VERSIONINFO = "PIPE-based IPC Module (pipe-ipc.js) version 0.1.19"; exports.AUTHOR = "abuse@catswords.net"; exports.global = global; exports.require = require;