Skip to content

Commit

Permalink
set encoding for reader to utf8
Browse files Browse the repository at this point in the history
  • Loading branch information
greelgorke committed Jan 17, 2013
1 parent 0ec4894 commit 308ad69
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Readme.md
Expand Up @@ -47,6 +47,7 @@ Instead of the log level constants, you may also supply a string:
console.log(line);
});

__Note: log.js asumes utf8 encoded data.__
Example stdout:

{ date: Sun, 26 Sep 2010 01:26:14 GMT
Expand Down
4 changes: 2 additions & 2 deletions lib/log.js
Expand Up @@ -107,7 +107,7 @@ Log.prototype = {
, self = this
, stream = this.stream;

stream.setEncoding('ascii');
stream.setEncoding('utf8');
stream.on('data', function(chunk){
buf += chunk;
if ('\n' != buf[buf.length - 1]) return;
Expand Down Expand Up @@ -250,4 +250,4 @@ Log.prototype = {
* Inherit from `EventEmitter`.
*/

Log.prototype.__proto__ = EventEmitter.prototype;
Log.prototype.__proto__ = EventEmitter.prototype;

0 comments on commit 308ad69

Please sign in to comment.