From d57a4b6e472dea3c3b3593b694a21c0682da0654 Mon Sep 17 00:00:00 2001 From: teamdstn Date: Fri, 9 Aug 2013 15:23:42 +0900 Subject: [PATCH] add setEncoding UTF8 add ".stdout setEncoding('utf8')" for ISO-8859-1 special characters not translated correctly --- htmltidy.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htmltidy.js b/htmltidy.js index 6e501da..83de25b 100644 --- a/htmltidy.js +++ b/htmltidy.js @@ -29,8 +29,11 @@ function TidyWorker(opts) { this.writable= true; this.readable= true; this._worker = spawn(tidyExec, parseOpts(mergedOpts)); + this._worker.stdout.setEncoding('utf8'); //Fix : ISO-8859-1 special characters not translated correctly + var self = this; var errors = ''; + this._worker.stdin.on('drain', function () { self.emit('drain'); });