'this.write' also needs "if (typeof(input) === 'string') input = new Buffer(input);"

...er(input);

I tryed 'res.pipe(iconv).pipe(res)'.
Its argument is string type.