From 147886cbcb7edf36347926b50f763fd5fda2ae95 Mon Sep 17 00:00:00 2001 From: Jae Date: Sat, 16 Jul 2011 00:33:41 +0100 Subject: [PATCH] Revert "fix utf8 issue" This reverts commit 49a6352b73ab50a3b4639abd733da31c632abead. --- node_modules/thrift/protocol.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/node_modules/thrift/protocol.js b/node_modules/thrift/protocol.js index 79dfdb7..b5e1ab8 100644 --- a/node_modules/thrift/protocol.js +++ b/node_modules/thrift/protocol.js @@ -123,16 +123,9 @@ TBinaryProtocol.prototype.writeDouble = function(dub) { this.trans.write(BinaryParser.fromDouble(dub)); } -TBinaryProtocol.prototype.writeString = function(arg) { - if (typeof(arg) === 'string') { - this.writeI32(Buffer.byteLength(arg, 'utf8')) - this.trans.write(arg, 'utf8'); - } else if (arg instanceof Buffer) { - this.writeI32(arg.length) - this.trans.write(arg); - } else { - throw new Error('writeString called without a string/Buffer argument: ' + arg) - } +TBinaryProtocol.prototype.writeString = function(str) { + this.writeI32(str.length); + this.trans.write(str); } TBinaryProtocol.prototype.readMessageBegin = function() {