missing response.setEncoding('utf8') #119

Open
wants to merge 1 commit into
from

Conversation

Projects
None yet
1 participant

jackyz commented Nov 28, 2012

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment