The error checking is not complete in this change - the code should
handle the case where an input string is not valid utf8.
The code will continue to run on Python2 after this change, however
the execution time on Python2 is measurably slower after making this
change.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>