Fix joyent/node#8683

This PR fixed the encoding issue of converting external string into Buffer (#8683).
Does this pass `make cpplint`?