fix encoding errors with io.StringIO in python2
Merge pull request #14 from apieum/master

fix encoding errors with io.StringIO in python2