Worth unit tests and care here. There are binary bytes which don't get properly represented / converted into JS strings. Be especially careful about non-printable characters & \0's.