Chunking responses with e.g. UTF-16 bodies fails, since the can't simply be joined with binary encoded content. Please check my solution, not sure if this is the best approach though.
Ensure correct encoding on chunked responses
Thank you. Also congrats, this may be the first correct encoding patch I can remember rack ever receiving from a community member!
(don't quote me on that, my memory for patch correctness may not be that accurate - either way, thanks)