I'd like to encode binary data more efficiently than Base64 for transferring data to browsers. It doesn't need to be human-readable, it should just survive being transferred as UTF-8.
Since not all byte sequences are valid UTF-8, the data needs to be converted somehow.
It would need to be a solution that works in the browser.
Is this possible?