Nbsp character becoming corrupt on clean

Same issue as #8, raising as a separate issue as a pull request.
When passing in a UTF8 byte string containing a nbsp character, it becomes corrupted.