Skip to content

Instantly share code, notes, and snippets.

@euoia
Created March 12, 2013 15:02
Show Gist options
  • Save euoia/5143637 to your computer and use it in GitHub Desktop.
Save euoia/5143637 to your computer and use it in GitHub Desktop.
~|⇒ node
> var net = require ('net');
undefined
> var socket = net.createConnection(8888, 'localhost', function () { socket.write ('hello', 'ascii') });
undefined
> socket.setEncoding('utf8');
undefined
> socket.setEncoding('utf-8');
undefined
> socket.setEncoding('utf-asdqa8');
Error: Unknown encoding: utf-asdqa8
at assertEncoding (string_decoder.js:24:11)
at new exports.StringDecoder (string_decoder.js:30:3)
at Socket.Readable.setEncoding (_stream_readable.js:161:33)
at repl:1:8
at REPLServer.self.eval (repl.js:110:21)
at repl.js:249:20
at REPLServer.self.eval (repl.js:122:7)
at Interface.<anonymous> (repl.js:239:12)
at Interface.EventEmitter.emit (events.js:94:17)
at Interface._onLine (readline.js:202:10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment