Skip to content

Commit

Permalink
set encoding properly for fs.*stream
Browse files Browse the repository at this point in the history
  • Loading branch information
dodo committed Nov 19, 2013
1 parent eda2eba commit 08f297e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions install.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ stringify = function (key, value) {

newFile = function (name, callback) {
var filename = path.join(__dirname, "category", name + ".js"),
file = fs.createWriteStream(filename, 'utf8');
file = fs.createWriteStream(filename, {encoding:'utf8'});
file.once('close', function () {
if (!--refs) {
console.log("done.");
Expand Down Expand Up @@ -113,7 +113,7 @@ read_file = function (success_cb, error_cb) {
return try_reading(success_cb, error_cb);
}
console.log("parsing …");
fs.createReadStream(systemfile, 'utf8').pipe(parser(success_cb));
fs.createReadStream(systemfile, {encoding:'utf8'}).pipe(parser(success_cb));
});

};
Expand Down

0 comments on commit 08f297e

Please sign in to comment.