Well, apart from fixing the broken assumption that everything fits into a string, you can serialise to binary any way that works and then base-64 or hex encode the binary blob to go through th string pathway.