Fix for #304: test for `str`, not `"utf-8"`.

The code wants to produce a `str` object for the given Python version (which is the right thing to do here).
Merge pull request #306 from mjpieters/master

Fix for #304: test for `str`, not `"utf-8"`.