I'd recommend sending base64'd data down. Use this to encode/decode from javascript strings of 1-byte-per-character data:
https://github.com/mcarter/js.io/blob/master/packages/std/ba...
https://github.com/mcarter/js.io/blob/master/packages/std/ba...
If you're writing this for client side, it would indeed be preferable to use the native functions.