Ok, so somehow the user name was encoded but not decoded. That would of course be open to all sorts of problems, not just spaces, but of course that depends on the actual user ids themselves.
Best you find where you are retrieving that user name and insure it is properly handled, both in encoding and decoding.