I camr across that bit of code while googling to see if I could find sometghing specific to help you out. But like you said, a lot of pages did mention that if any truncation would occur, or any slight manipulation of the string, the "new" binary would be radically different.
I know how you feel though. I've had countless times where I was very close to a solution, and then started trying out various things, only to find out i most likely did try the proper solution, but not with the right amount of parameters or something like that :)
Just out of curiosity, are you trying to export BLOBs, or is the problem the default binary data stored in the profile table?