Count stream size in bytes not characters.
Better handling of multi-byte UTF-8 characters.

This patch should resolve some encoding issues where multi-byte
characters are split between buffers, and not encoded properly.
Merge pull request #30 from RickMoynihan/master

Count stream size in bytes not characters, and better handling of UTF-8