SaltwaterC/aws2js — pull request #56 by mattmonson (2012-08-08 11:17:51+00:00)
Title: Fix s3.put truncation of utf8-encoded string

When makeRequest calculates the content-length of a string, it doesn't
take the eventual utf8 encoding of that string into account. So if any
of the characters in the string expand out to multiple bytes in the utf8
encoding, the string will be truncated by that many characters.

The fix is to use Buffer.byteLength(string) to calculate the
content-length. It uses the same default utf8 encoding that
request.write(string) uses.