The space character is dropped in the conversions to_utf8 and to_marc8. This happens because of the way the _unpack function is implemented. It uses pack/unpack pattern "A3" which removes trailing spaces. But if the packed string starts with three spaces, all three spaces are removed.
Here is one possible way to fix the problem: