Made the tests work with Python 3
Fixed segfault on invalid unicode char on python 3
Merge pull request #149 from Jahaja/fix2

Fixed segfault on invalid unicode char on python 3