ciaranj/node-oauth — pull request #119 by jackyz (2012-11-28 02:21:40+00:00)
Title: missing response.setEncoding('utf8')

I thought oauth2.js missed one line `response.setEncoding('utf8')`, the oauh.js has this line.

But missing the line, the `chunk` is a buffer, and `result+= chunk` will cause encoding problem. Because one char in utf8 (one char in may bytes) maybe separated into two buffers. and `result+=chunk` implies chunk convert to string first, so one good char becomes two broken char.

This is the same problem as issues #118, and I think pull request #80 is a good idea, but it should be applied to oauth2.js as well.