Skip to content

Commit 38c8327

Browse files
committed
Merge pull request tj#14 from greelgorke/reader_encoding
reading feature: make encoding configurable
2 parents 0ec4894 + 8781750 commit 38c8327

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Instead of the log level constants, you may also supply a string:
4747
console.log(line);
4848
});
4949

50+
__Note: log.js assumes utf8 encoded data.__
5051
Example stdout:
5152

5253
{ date: Sun, 26 Sep 2010 01:26:14 GMT

lib/log.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Log.prototype = {
107107
, self = this
108108
, stream = this.stream;
109109

110-
stream.setEncoding('ascii');
110+
stream.setEncoding('utf8');
111111
stream.on('data', function(chunk){
112112
buf += chunk;
113113
if ('\n' != buf[buf.length - 1]) return;
@@ -250,4 +250,4 @@ Log.prototype = {
250250
* Inherit from `EventEmitter`.
251251
*/
252252

253-
Log.prototype.__proto__ = EventEmitter.prototype;
253+
Log.prototype.__proto__ = EventEmitter.prototype;

0 commit comments

Comments
 (0)