Fixed problems when the default charset is not able to represent the byte stream.
Merge pull request #1 from rjrudman/master

Fixed problems when the default charset is not able to represent the bytestream